Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/PyMca5/PyMcaGui/pymca/PyMcaMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,18 @@
if __name__ == "__main__":
sys.excepthook = qt.exceptionHandler

# To avoid "Dark mode"; this force main windows to be light (but not all submenus)
if sys.platform == 'win32':
_ = os.environ.setdefault("QT_QPA_PLATFORM", "windows:darkmode=0")

app = qt.QApplication(sys.argv)

# To avoid "Dark mode"; without this part some menus will be still dark
if sys.platform == 'win32':
platform = os.environ.get("QT_QPA_PLATFORM", "")
if "darkmode=0" in platform:
app.setStyle('fusion')

if sys.platform not in ["win32", "darwin"]:
# some themes of Ubuntu 16.04 give black tool tips on black background
app.setStyleSheet("QToolTip { color: #000000; background-color: #fff0cd; border: 1px solid black; }")
Expand Down