Doc fixes, running examples instructions, change menubar behavior for desktop
This commit is contained in:
3 files changed
+29
-17
No files matched your search
@@ -219,6 +219,10 @@ Dioxus has grown from a side project to a small team of fulltime engineers. Than
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
## Running the examples
|
||||||
|
|
||||||
|
The examples in the top level of this repository can be run with `cargo run --example <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
|
## 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.
|
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.
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ impl App {
|
|||||||
webviews: HashMap::new(),
|
webviews: HashMap::new(),
|
||||||
control_flow: ControlFlow::Wait,
|
control_flow: ControlFlow::Wait,
|
||||||
unmounted_dom: Cell::new(Some(virtual_dom)),
|
unmounted_dom: Cell::new(Some(virtual_dom)),
|
||||||
float_all: cfg!(debug_assertions),
|
float_all: !cfg!(debug_assertions),
|
||||||
cfg: Cell::new(Some(cfg)),
|
cfg: Cell::new(Some(cfg)),
|
||||||
shared: Rc::new(SharedContext {
|
shared: Rc::new(SharedContext {
|
||||||
event_handlers: WindowEventHandlers::default(),
|
event_handlers: WindowEventHandlers::default(),
|
||||||
|
|||||||
@@ -88,28 +88,36 @@ mod desktop_platforms {
|
|||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let help_menu = Submenu::new("Help", true);
|
menu.append_items(&[&window_menu, &edit_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
|
if cfg!(debug_assertions) {
|
||||||
help_menu
|
let help_menu = Submenu::new("Help", true);
|
||||||
.append_items(&[&MenuItem::with_id(
|
|
||||||
"dioxus-float-top",
|
|
||||||
"Float on Top (dev mode only)",
|
|
||||||
true,
|
|
||||||
None,
|
|
||||||
)])
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
menu.append_items(&[&window_menu, &edit_menu, &help_menu])
|
help_menu
|
||||||
.unwrap();
|
.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")]
|
#[cfg(target_os = "macos")]
|
||||||
{
|
{
|
||||||
window_menu.set_as_windows_menu_for_nsapp();
|
window_menu.set_as_windows_menu_for_nsapp();
|
||||||
help_menu.set_as_help_menu_for_nsapp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu
|
menu
|
||||||
|
|||||||
Reference in new issue
Block a user