fix: issue #9 moved windows menu

This commit is contained in:
2026-07-05 18:13:07 +02:00
parent ae1c8703e7
commit ae2e534fdb
13 changed files with 577 additions and 346 deletions

View File

@@ -8,6 +8,7 @@ defmodule BDS.UI.Commands do
%{id: :import_media, accelerator: "CTRL+I"},
%{id: :save, accelerator: "CTRL+S"},
%{id: :close_tab, accelerator: "CTRL+W", key: "w", primary: true},
%{id: :minimize, accelerator: "CTRL+M"},
%{id: :quit, accelerator: "CTRL+Q"},
%{id: :undo, accelerator: "CTRL+Z"},
%{id: :redo, accelerator: "CTRL+Y"},

View File

@@ -7,6 +7,7 @@ defmodule BDS.UI.MenuBar do
@spec default_groups(keyword()) :: [map()]
def default_groups(opts \\ []) do
dev_mode? = Keyword.get(opts, :dev_mode?, false)
window_menu? = Keyword.get(opts, :window_menu?, false)
[
%{
@@ -67,16 +68,38 @@ defmodule BDS.UI.MenuBar do
%{id: :validate_site},
%{id: :upload_site}
]
},
}
] ++
window_group(window_menu?) ++
[
%{
id: :help,
items: [
%{id: :about},
%{id: :documentation},
%{id: :api_documentation},
%{separator: true},
%{id: :view_on_github},
%{id: :report_issue}
]
}
]
end
# The native macOS menu enables this group; wx's automatic Window menu is
# disabled because it races the async menubar populate and lands in the
# wrong position (see BDS.Application.disable_auto_window_menu/0).
defp window_group(false), do: []
defp window_group(true) do
[
%{
id: :help,
id: :window,
items: [
%{id: :about},
%{id: :documentation},
%{id: :api_documentation},
%{id: :minimize},
%{id: :zoom},
%{separator: true},
%{id: :view_on_github},
%{id: :report_issue}
%{id: :bring_all_to_front}
]
}
]