Skip to content

Commit

Permalink
switch to a three colomn layout
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Apr 22, 2024
1 parent 4a19fff commit d110904
Showing 1 changed file with 32 additions and 21 deletions.
53 changes: 32 additions & 21 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ impl Model for LambData {}
pub(crate) fn default_state() -> Arc<ViziaState> {
// width , height
// ViziaState::new(|| (((16.0 / 9.0) * 720.0) as u32, 720))
// ViziaState::new(|| (1280, 960))
ViziaState::new(|| (1200, 900))
ViziaState::new(|| (1280, 720))
}

pub(crate) fn create(
Expand Down Expand Up @@ -92,9 +91,9 @@ pub(crate) fn create(
Label::new(cx, "input gain").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.input_gain)
.bottom(Pixels(6.0));
// level + time
// three colomns
HStack::new(cx, |cx| {
// level
// first
VStack::new(cx, |cx| {
HStack::new(cx, |cx| {
// bypass and latency_mode
Expand Down Expand Up @@ -130,15 +129,29 @@ pub(crate) fn create(
ParamSlider::new(cx, LambData::params, |params| &params.thresh);
Label::new(cx, "knee").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.knee);
Label::new(cx, "link").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.link);
}) // first
.height(Auto)
.class("center")
.right(Percentage(2.5));
// second
VStack::new(cx, |cx| {
Label::new(cx, "lookahead").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.lookahead);
}) // level
Label::new(cx, "link").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.link);
Label::new(cx, "release hold").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.release_hold);
Label::new(cx, "adaptive release").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| {
&params.adaptive_release
})
.set_style(ParamSliderStyle::FromLeft);
}) // second
.height(Auto)
.class("center")
.right(Percentage(2.5));
// time
.left(Percentage(1.25))
.right(Percentage(1.25));
// third
VStack::new(cx, |cx| {
Label::new(cx, "attack").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.attack);
Expand All @@ -149,25 +162,19 @@ pub(crate) fn create(
Label::new(cx, "release shape").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.release_shape)
.set_style(ParamSliderStyle::FromLeft);
Label::new(cx, "release hold").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.release_hold);
Label::new(cx, "adaptive release").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| {
&params.adaptive_release
})
.set_style(ParamSliderStyle::FromLeft);
}) // time
}) // third
.height(Auto)
.class("center")
.left(Percentage(2.5));
})
.height(Auto)
.width(Percentage(100.0)); // level + time
.width(Percentage(100.0)); // three colomns

Label::new(cx, "output gain").class("fader-label");
ParamSlider::new(cx, LambData::params, |params| &params.output_gain)
.bottom(Pixels(6.0));
}) // parameters
.width(Percentage(75.0))
.height(Auto)
.right(Percentage(2.5))
.class("center");
Expand All @@ -183,7 +190,12 @@ pub(crate) fn create(
.set_style(ParamSliderStyle::CurrentStepLabeled { even: true })
.bottom(Pixels(6.0));
Label::new(cx, "").class("fader-label"); // spacer
AttackReleaseGraph::new(cx, LambData::params).height(Pixels(373.0));
AttackReleaseGraph::new(cx, LambData::params).height(Pixels(200.0));
// .height(Pixels(260.0));
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));
}) // graph + zoom
.height(Auto)
.class("center");
Expand Down Expand Up @@ -463,7 +475,6 @@ fn peak_graph(cx: &mut Context) {
.color(Color::rgba(255, 0, 0, 125))
.background_color(Color::rgba(60, 60, 60, 60));
})
// .width(Pixels(30.0))
.border_color(Color::rgb(80, 80, 80))
.border_width(Pixels(1.));
UnitRuler::new(
Expand All @@ -484,7 +495,7 @@ fn peak_graph(cx: &mut Context) {
.width(Pixels(32.));
})
.top(Pixels(20.0))
.height(Pixels(326.0))
.height(Pixels(260.0))
.width(Percentage(100.0))
.col_between(Pixels(8.));
}

0 comments on commit d110904

Please sign in to comment.