add separator to slider

This commit is contained in:
2022-01-24 11:47:13 +01:00
parent 2b26e8a709
commit 89e3deaa35

View File

@@ -38,20 +38,28 @@ fn main() {
.margin_start(MARGIN_LEFT) .margin_start(MARGIN_LEFT)
.build(); .build();
let adjustment = Adjustment::builder()
.lower(0.0)
.upper(10.0)
.value(5.0)
.step_increment(1.0)
.build();
let scale = Scale::builder() let scale = Scale::builder()
.orientation(Orientation::Vertical) .orientation(Orientation::Vertical)
.adjustment(&adjustment) .adjustment(&adjustment)
.vexpand(true) .vexpand(true)
.margin_top(MARGIN_TOP) .margin_top(MARGIN_TOP)
.margin_bottom(MARGIN_BOTTOM) .margin_bottom(MARGIN_BOTTOM)
.margin_start(MARGIN_LEFT) .margin_start(MARGIN_LEFT / 2)
.margin_end(MARGIN_RIGHT / 2)
.draw_value(true) .draw_value(true)
.inverted(true) .inverted(true)
.round_digits(0) .round_digits(0)
.digits(0) .digits(0)
//(|x| eprintln!("Changed! {:?}", x))
.build(); .build();
let seperator = Separator::new(Orientation::Vertical);
let content = Box::builder() let content = Box::builder()
//.hexpand(true) //.hexpand(true)
.orientation(Orientation::Horizontal) .orientation(Orientation::Horizontal)
@@ -59,6 +67,7 @@ fn main() {
.build(); .build();
content.append(&scale); content.append(&scale);
content.append(&seperator);
content.append(&image); content.append(&image);
scale.connect_value_changed(move |x| { scale.connect_value_changed(move |x| {