Merge pull request #6053 from dotCooCoo/fix/wasm-menu-open-import

Menus: the wasm build has no unused import warning for menu_open
This commit is contained in:
BFlat
2026-11-08 12:59:24 +08:00
committed by GitHub
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -58,6 +58,7 @@ mod tree;
mod ui_commands;
pub use bar::menu_bar;
#[cfg(not(target_arch = "wasm32"))]
pub(crate) use bar::menu_open;
pub(crate) use bar::{home_key, home_showing};
#[cfg(test)]
+1
View File
@@ -68,6 +68,7 @@ fn menu_open_id() -> egui::Id {
}
/// Whether a menu of the in-window menu bar is open (`false` when no menu bar was drawn yet).
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn menu_open(ctx: &egui::Context) -> bool {
ctx.data(|d| d.get_temp::<bool>(menu_open_id())).unwrap_or(false)
}