mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-24 06:49:44 -05:00
Keep setting the style to Fusion for Darwin and Windows
This commit is contained in:
parent
a666a0620d
commit
c832e993de
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user