tweaks to the LastWindowClose to make it more imperative
This commit is contained in:
1 parent
9573af115a
commit
ff762cec84
11 files changed
+74
-214
No files matched your search
+2
-10
@@ -5,22 +5,14 @@
|
||||
//! own context, root elements, etc.
|
||||
|
||||
use dioxus::prelude::*;
|
||||
use dioxus::{desktop::Config, desktop::DefaultWindowCloseBehaviour};
|
||||
|
||||
fn main() {
|
||||
dioxus::LaunchBuilder::desktop()
|
||||
// We can choose the close behavior of the last window to hide. See DefaultWindowCloseBehaviour for more options.
|
||||
.with_cfg(
|
||||
Config::new()
|
||||
.with_default_window_close_behaviour(DefaultWindowCloseBehaviour::LastWindowHides),
|
||||
)
|
||||
.launch(app);
|
||||
dioxus::launch(app);
|
||||
}
|
||||
|
||||
fn app() -> Element {
|
||||
let onclick = move |_| {
|
||||
let dom = VirtualDom::new(popup);
|
||||
dioxus::desktop::window().new_window(dom, Default::default());
|
||||
dioxus::desktop::window().new_window(VirtualDom::new(popup), Default::default());
|
||||
};
|
||||
|
||||
rsx! {
|
||||
|
||||
Reference in new issue
Block a user