Skip to content

Commit

Permalink
fix overlapping gui elements while shrinking the window
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Apr 8, 2024
1 parent d940262 commit dac292d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
60 changes: 31 additions & 29 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub(crate) fn create(
Label::new(cx, "link").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.link);
}) // level
.height(Percentage(100.0))
.height(Auto)
.class("center")
.right(Percentage(2.5));
// time
Expand All @@ -120,40 +120,40 @@ pub(crate) fn create(
Label::new(cx, "release hold").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.release_hold);
}) // time
.class("center")
.left(Percentage(2.5));
.height(Auto)
.class("center")
.left(Percentage(2.5));
})
// .height(Percentage(100.0))
.height(Auto)
.width(Percentage(100.0)); // level + time

Label::new(cx, "output gain").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.output_gain)
.bottom(Pixels(6.0));
}) // parameters
.right(Percentage(2.5))
.class("center");
.height(Auto)
.right(Percentage(2.5))
.class("center");
// graph + zoom
VStack::new(cx, |cx| {
// Label::new(cx, "") // spacer
// Label::new(cx, ""); // spacer
Label::new(cx, "lamb") // title
.class("plugin-name")
.left(Stretch(1.0))
.right(Pixels(0.0));
VStack::new(cx, |cx| {
// label & slider
Label::new(cx, "zoom mode").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.zoom_mode)
.set_style(ParamSliderStyle::CurrentStepLabeled { even: true })
.bottom(Pixels(6.0));
Label::new(cx, "").class("fader-label"); // spacer
AttackReleaseGraph::new(cx, LambData::params);
}) // label & slider
.width(Percentage(100.0))
.class("center");
Label::new(cx, "zoom mode").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.zoom_mode)
.set_style(ParamSliderStyle::CurrentStepLabeled { even: true })
.bottom(Pixels(6.0));
Label::new(cx, "").class("fader-label"); // spacer
AttackReleaseGraph::new(cx, LambData::params).height(Pixels(317.0));
}) // graph + zoom
.class("center")
.height(Percentage(100.0)); // graph + zoom
})
.width(Percentage(100.0)); // parameters + graph
.height(Auto)
.class("center");
}) // parameters + graph
.height(Auto)
.width(Percentage(100.0));

// meters
VStack::new(cx, |cx| {
Expand Down Expand Up @@ -181,15 +181,17 @@ pub(crate) fn create(
)
.width(Percentage(100.0));
}) // meters
.width(Percentage(100.0))
.height(Auto)
.class("center"); // meters
.width(Percentage(100.0))
// .height(Percentage(100.0))
.height(Auto)
.class("center"); // meters
}) // everything
.width(Percentage(95.0))
.height(Percentage(95.0))
.left(Percentage(2.5))
.right(Percentage(2.5))
.class("center");
.width(Percentage(95.0))
// .height(Percentage(95.0))
.height(Auto)
.left(Percentage(2.5))
.right(Percentage(2.5))
.class("center");
ResizeHandle::new(cx);
})
}
Expand Down
1 change: 0 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ attack-release-graph {
border-color: #696969;
background-color: #f0f0f0;
border-width: 1px;
bottom: 5px;
}
.fader-label {
top: 7px;
Expand Down

0 comments on commit dac292d

Please sign in to comment.