mirror of
https://github.com/danbulant/cushy
synced 2026-05-20 12:48:41 +00:00
21 lines
554 B
Rust
21 lines
554 B
Rust
use cushy::figures::Fraction;
|
|
use cushy::value::{Dynamic, Source};
|
|
use cushy::widget::MakeWidget;
|
|
use cushy::widgets::slider::Slidable;
|
|
use cushy::Run;
|
|
|
|
fn main() -> cushy::Result<()> {
|
|
let zoom = Dynamic::new(Fraction::ONE);
|
|
zoom.map_each(|z| z.to_string())
|
|
.and(
|
|
zoom.clone()
|
|
.slider_between(Fraction::new(1, 4), Fraction::new(4, 1)),
|
|
)
|
|
.into_rows()
|
|
.fit_horizontally()
|
|
.pad()
|
|
.expand()
|
|
.into_window()
|
|
.zoom(zoom)
|
|
.run()
|
|
}
|