fix: menues now working, also project selector

This commit is contained in:
2026-04-04 20:39:29 +02:00
parent e2ef6c925a
commit 1e6de6ac1c
8 changed files with 318 additions and 27 deletions

View File

@@ -289,15 +289,18 @@ pub fn build_menu_bar(locale: UiLocale) -> (Menu, MenuRegistry) {
let _ = menu.append(&blog_menu);
let _ = menu.append(&help_menu);
// Attach on macOS
#[cfg(target_os = "macos")]
{
let _ = menu.init_for_nsapp();
}
(menu, reg)
}
/// Attach the built menu to the macOS NSApp.
///
/// Must be called **after** the event loop has started (e.g. from the
/// init task or first update), not during `build_menu_bar`.
#[cfg(target_os = "macos")]
pub fn init_menu_for_nsapp(menu: &Menu) {
let _ = menu.init_for_nsapp();
}
/// Re-translate every registered menu item for a new locale.
pub fn update_menu_labels(registry: &MenuRegistry, locale: UiLocale) {
for &action in MenuAction::ALL {