diff --git a/README.md b/README.md index 6e4be4e7d..20cdfce12 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,10 @@ Dioxus has grown from a side project to a small team of fulltime engineers. Than +## Running the examples + +The examples in the top level of this repository can be run with `cargo run --example `. However, we encourage you to download the dioxus-cli and run the examples with `dx serve` since many examples also support web. When running for web, you either need to modify the Cargo.toml to disable the default desktop feature, or use + ## Dioxus vs other frameworks We love all frameworks and enjoy watching innovation in the Rust ecosystem. In fact, many of our projects are shared with other frameworks. For example, our flex-box library [Taffy](https://github.com/DioxusLabs/taffy) is used by [Bevy](https://bevyengine.org/), [Zed](https://zed.dev/), [Lapce](https://lapce.dev/), [Iced](https://github.com/iced-rs/iced), and many more. diff --git a/packages/desktop/src/app.rs b/packages/desktop/src/app.rs index 6efbf2c08..6c929ad21 100644 --- a/packages/desktop/src/app.rs +++ b/packages/desktop/src/app.rs @@ -63,7 +63,7 @@ impl App { webviews: HashMap::new(), control_flow: ControlFlow::Wait, unmounted_dom: Cell::new(Some(virtual_dom)), - float_all: cfg!(debug_assertions), + float_all: !cfg!(debug_assertions), cfg: Cell::new(Some(cfg)), shared: Rc::new(SharedContext { event_handlers: WindowEventHandlers::default(), diff --git a/packages/desktop/src/menubar.rs b/packages/desktop/src/menubar.rs index c434bc787..a46cabf1d 100644 --- a/packages/desktop/src/menubar.rs +++ b/packages/desktop/src/menubar.rs @@ -88,28 +88,36 @@ mod desktop_platforms { ]) .unwrap(); - let help_menu = Submenu::new("Help", true); - help_menu - .append_items(&[&MenuItem::new("Toggle Developer Tools", true, None)]) - .unwrap(); + menu.append_items(&[&window_menu, &edit_menu]).unwrap(); - // By default we float the window on top in dev mode, but let the user disable it - help_menu - .append_items(&[&MenuItem::with_id( - "dioxus-float-top", - "Float on Top (dev mode only)", - true, - None, - )]) - .unwrap(); + if cfg!(debug_assertions) { + let help_menu = Submenu::new("Help", true); - menu.append_items(&[&window_menu, &edit_menu, &help_menu]) - .unwrap(); + help_menu + .append_items(&[&MenuItem::new("Toggle Developer Tools", true, None)]) + .unwrap(); + + // By default we float the window on top in dev mode, but let the user disable it + help_menu + .append_items(&[&MenuItem::with_id( + "dioxus-float-top", + "Float on Top (dev mode only)", + true, + None, + )]) + .unwrap(); + + _ = menu.append_items(&[&help_menu]); + + #[cfg(target_os = "macos")] + { + help_menu.set_as_help_menu_for_nsapp(); + } + } #[cfg(target_os = "macos")] { window_menu.set_as_windows_menu_for_nsapp(); - help_menu.set_as_help_menu_for_nsapp(); } menu