Skip to content

Commit

Permalink
Disable File menu in Web
Browse files Browse the repository at this point in the history
  • Loading branch information
zakarumych committed Jan 22, 2024
1 parent 6f202c4 commit e843534
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,15 @@ impl App for DemoApp {
// The top panel is often a good place for a menu bar:

egui::menu::bar(ui, |ui| {
ui.menu_button("File", |ui| {
if ui.button("Quit").clicked() {
ctx.send_viewport_cmd(egui::ViewportCommand::Close)
}
});
ui.add_space(16.0);
#[cfg(not(target_arch = "wasm32"))]
{
ui.menu_button("File", |ui| {
if ui.button("Quit").clicked() {
ctx.send_viewport_cmd(egui::ViewportCommand::Close)
}
});
ui.add_space(16.0);
}

egui::widgets::global_dark_light_mode_switch(ui);
});
Expand Down

0 comments on commit e843534

Please sign in to comment.