Menus: the wasm build has no unused import warning for menu_open

The only callers of `menus::menu_open` are the native palette-window
code in `panel_docking.rs` and its native tests, so on wasm32 the
re-export and the function were unused and `cargo xtask wasm` printed
two warnings for them. Both now carry `#[cfg(not(target_arch = "wasm32"))]`.
The menu bar still records whether a menu is open on every target.
This commit is contained in:
dotCooCoo
2026-11-08 11:42:45 +07:00
committed by bflatastic
parent f4ccca02d0
commit a18364e2b4
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)
}