Merge branch 'upstream' into simplify-native-core

This commit is contained in:
Evan Almloff committed 2023-03-14 16:21:39 -05:00
1 parent 4b81cdbf1b
commit 41bf87e74f
63 files changed
+818 -245

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
use dioxus::prelude::*;
use dioxus_desktop::tao::keyboard::ModifiersState;
use dioxus_desktop::use_global_shortcut;
fn main() {
dioxus_desktop::launch(app);
}
fn app(cx: Scope) -> Element {
let toggled = use_state(cx, || false);
use_global_shortcut(cx, KeyCode::S, ModifiersState::CONTROL, {
to_owned![toggled];
move || toggled.modify(|t| !*t)
});
cx.render(rsx!("toggle: {toggled.get()}"))
}