diff --git a/src/main/python/main/ayab/menu.py b/src/main/python/main/ayab/menu.py index 65e234aa..ad2e5977 100644 --- a/src/main/python/main/ayab/menu.py +++ b/src/main/python/main/ayab/menu.py @@ -19,6 +19,7 @@ # https://github.com/AllYarnsAreBeautiful/ayab-desktop from __future__ import annotations +from PySide6.QtCore import QOperatingSystemVersion from PySide6.QtWidgets import QMenuBar from .menu_gui import Ui_MenuBar @@ -38,6 +39,11 @@ class Menu(QMenuBar): def __init__(self, parent: GuiMain): super().__init__(parent) + + # Use native menubar on macOS, not elsewhere (i.e. Linux) + if QOperatingSystemVersion.currentType() != QOperatingSystemVersion.OSType.MacOS: + self.setNativeMenuBar(False) + self.ui = Ui_MenuBar() self.ui.setupUi(self) self.setup() diff --git a/src/main/python/main/ayab/menu_gui.ui b/src/main/python/main/ayab/menu_gui.ui index b0f47cb7..10e25cfc 100644 --- a/src/main/python/main/ayab/menu_gui.ui +++ b/src/main/python/main/ayab/menu_gui.ui @@ -2,9 +2,6 @@ MenuBar - - False - File @@ -68,6 +65,9 @@ Ctrl+Q + + QAction::QuitRole + @@ -99,6 +99,9 @@ Help – About + + QAction::AboutRole + @@ -192,6 +195,9 @@ Ctrl+P + + QAction::PreferencesRole +