2022-05-11 16:03:42 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
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 {
|
2022-12-07 21:11:40 +00:00
|
|
|
let level = use_state(cx, || 1.0);
|
2022-12-30 07:09:02 +00:00
|
|
|
|
2022-05-11 16:03:42 +00:00
|
|
|
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| {
|
2023-09-01 20:38:55 +00:00
|
|
|
if let Ok(new_zoom) = e.value().parse::<f64>() {
|
2022-12-30 07:32:53 +00:00
|
|
|
level.set(new_zoom);
|
2023-10-23 20:26:10 +00:00
|
|
|
dioxus_desktop::window().webview.zoom(new_zoom);
|
2022-12-30 07:32:53 +00:00
|
|
|
}
|
2022-05-11 16:03:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|