mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-08 07:11:31 +00:00
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:
@@ -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)]
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user