diff options
author | Micah Lee <micah@micahflee.com> | 2022-07-04 16:54:48 -0400 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2022-07-04 16:54:48 -0400 |
commit | c832e993deacd668d87bdf719e2e290834c0e39b (patch) | |
tree | 88af302fbd93e6f0d38ba8187fe61f6e99039c78 /desktop/onionshare/__init__.py | |
parent | a666a0620d3a07eb935813ab72082d7f67033d06 (diff) | |
download | onionshare-c832e993deacd668d87bdf719e2e290834c0e39b.tar.gz onionshare-c832e993deacd668d87bdf719e2e290834c0e39b.zip |
Keep setting the style to Fusion for Darwin and Windows
Diffstat (limited to 'desktop/onionshare/__init__.py')
-rw-r--r-- | desktop/onionshare/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/desktop/onionshare/__init__.py b/desktop/onionshare/__init__.py index 6d70719e..de68f6f4 100644 --- a/desktop/onionshare/__init__.py +++ b/desktop/onionshare/__init__.py @@ -28,7 +28,7 @@ import psutil import getpass from PySide2 import QtCore, QtWidgets, QtGui -from PySide2.QtCore import Slot,Qt +from PySide2.QtCore import Slot, Qt from PySide2.QtGui import QPalette, QColor from onionshare_cli.common import Common @@ -51,8 +51,12 @@ class Application(QtWidgets.QApplication): self.setDesktopFileName("org.onionshare.OnionShare") self.setOrganizationDomain("org.onionshare.OnionShare") self.setOrganizationName("OnionShare") + QtWidgets.QApplication.__init__(self, sys.argv) + if common.platform == "Darwin" or common.platform == "Windows": + self.setStyle("Fusion") + # Check color mode on starting the app self.color_mode = self.get_color_mode(common) @@ -117,7 +121,9 @@ class Application(QtWidgets.QApplication): dark_palette.setColor(QPalette.Highlight, QColor(42, 130, 218)) dark_palette.setColor(QPalette.HighlightedText, Qt.black) self.setPalette(dark_palette) - self.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }") + self.setStyleSheet( + "QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }" + ) def get_color_mode(self, common): curr_settings = Settings(common) @@ -131,6 +137,7 @@ class Application(QtWidgets.QApplication): else: return "dark" if self.is_dark_mode() else "light" + def main(): """ The main() function implements all of the logic that the GUI version of onionshare uses. |