Desktop: Add app menu for Mac (#3428)

* add mac app menu

* review fixup

* Remove "About Graphite" ellipsis, add "Show All", make it say "Quit Graphite"

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Timon
2025-11-28 23:42:14 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 406f3d93f3
commit bb4516e377
15 changed files with 230 additions and 93 deletions
+15
View File
@@ -11,6 +11,9 @@ pub(crate) trait NativeWindow {
fn configure(attributes: WindowAttributes, event_loop: &dyn ActiveEventLoop) -> WindowAttributes;
fn new(window: &dyn WinitWindow, app_event_scheduler: AppEventScheduler) -> Self;
fn update_menu(&self, _entries: Vec<MenuItem>) {}
fn hide(&self) {}
fn hide_others(&self) {}
fn show_all(&self) {}
}
#[cfg(target_os = "linux")]
@@ -93,6 +96,18 @@ impl Window {
let _ = self.winit_window.drag_window();
}
pub(crate) fn hide(&self) {
self.native_handle.hide();
}
pub(crate) fn hide_others(&self) {
self.native_handle.hide_others();
}
pub(crate) fn show_all(&self) {
self.native_handle.show_all();
}
pub(crate) fn set_cursor(&self, cursor: winit::cursor::Cursor) {
self.winit_window.set_cursor(cursor);
}