2022-05-11 16:03:42 +00:00
|
|
|
use dioxus::prelude::*;
|
2022-07-09 19:15:20 +00:00
|
|
|
use dioxus_desktop::use_window;
|
2022-05-11 16:03:42 +00:00
|
|
|
|
|
|
|
fn main() {
|
2022-07-09 19:15:20 +00:00
|
|
|
dioxus_desktop::launch(app);
|
2022-05-11 16:03:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
|
|
let window = use_window(&cx);
|
|
|
|
|
|
|
|
let level = use_state(&cx, || 1.0);
|
|
|
|
cx.render(rsx! {
|
|
|
|
input {
|
|
|
|
r#type: "number",
|
2022-05-11 16:05:59 +00:00
|
|
|
value: "{level}",
|
2022-05-11 16:03:42 +00:00
|
|
|
oninput: |e| {
|
2022-05-12 00:41:30 +00:00
|
|
|
let num = e.value.parse::<f64>().unwrap_or(1.0);
|
|
|
|
level.set(num);
|
|
|
|
window.set_zoom_level(num);
|
2022-05-11 16:03:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|