Skip to content

Commit

Permalink
Use native menubar on macOS, not elsewhere (i.e. Linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanperret committed Aug 1, 2024
1 parent 2e4adef commit 127a205
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/main/python/main/ayab/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# https://github.com/AllYarnsAreBeautiful/ayab-desktop

from __future__ import annotations
from PySide6.QtCore import QSysInfo
from PySide6.QtWidgets import QMenuBar

from .menu_gui import Ui_MenuBar
Expand All @@ -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 QSysInfo.productType() != "macos":
self.setNativeMenuBar(False)

self.ui = Ui_MenuBar()
self.ui.setupUi(self)
self.setup()
Expand Down
3 changes: 0 additions & 3 deletions src/main/python/main/ayab/menu_gui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<ui version="4.0">
<class>MenuBar</class>
<widget class="QMenuBar" name="menubar">
<property name="nativeMenuBar">
<bool>False</bool>
</property>
<widget class="QMenu" name="menu_file">
<property name="title">
<string>File</string>
Expand Down

0 comments on commit 127a205

Please sign in to comment.