mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-23 08:06:46 +00:00
Merge pull request #980 from phw/PICARD-1358-macos-native-style
PICARD-1358: Use native Qt style for macOS
This commit is contained in:
@@ -129,7 +129,8 @@ class Tagger(QtWidgets.QApplication):
|
||||
|
||||
# Use the new fusion style from PyQt5 for a modern and consistent look
|
||||
# across all OSes.
|
||||
self.setStyle('Fusion')
|
||||
if sys.platform != "darwin":
|
||||
self.setStyle('Fusion')
|
||||
|
||||
# Set the WM_CLASS to 'MusicBrainz-Picard' so desktop environments
|
||||
# can use it to look up the app
|
||||
@@ -187,6 +188,10 @@ class Tagger(QtWidgets.QApplication):
|
||||
signal.signal(signal.SIGINT, self.signal)
|
||||
signal.signal(signal.SIGTERM, self.signal)
|
||||
|
||||
if sys.platform == "darwin":
|
||||
# On macOS it is not common that the global menu shows icons
|
||||
self.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus)
|
||||
|
||||
# Setup logging
|
||||
log.debug("Starting Picard from %r", os.path.abspath(__file__))
|
||||
log.debug("Platform: %s %s %s", platform.platform(),
|
||||
|
||||
@@ -21,6 +21,7 @@ from collections import OrderedDict
|
||||
import datetime
|
||||
from functools import partial
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
from PyQt5 import (
|
||||
QtCore,
|
||||
@@ -127,6 +128,11 @@ class MainWindow(QtWidgets.QMainWindow, PreserveGeometry):
|
||||
self.create_toolbar()
|
||||
self.create_menus()
|
||||
|
||||
if sys.platform == "darwin":
|
||||
self.setUnifiedTitleAndToolBarOnMac(True)
|
||||
self.toolbar.setMovable(False)
|
||||
self.search_toolbar.setMovable(False)
|
||||
|
||||
mainLayout = QtWidgets.QSplitter(QtCore.Qt.Vertical)
|
||||
mainLayout.setContentsMargins(0, 0, 0, 0)
|
||||
mainLayout.setHandleWidth(1)
|
||||
|
||||
Reference in New Issue
Block a user