mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
22 lines
475 B
Rust
22 lines
475 B
Rust
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
launch_desktop(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
let mut level = use_signal(|| 1.0);
|
|
|
|
render! {
|
|
input {
|
|
r#type: "number",
|
|
value: "{level}",
|
|
oninput: move |e| {
|
|
if let Ok(new_zoom) = e.value().parse::<f64>() {
|
|
level.set(new_zoom);
|
|
dioxus_desktop::window().webview.zoom(new_zoom);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|