Conversation
woutdenolf
left a comment
There was a problem hiding this comment.
I made some suggestions but I would prefer something better.
The idea is that the PyMca widgets don't show up well in dark mode.
So something like
from PyQt6.QtCore import Qt
def set_light_mode(app: QApplication):
app.styleHints().setColorScheme(Qt.ColorScheme.Light)or
from PyQt6.QtWidgets import QApplication
from PyQt6.QtGui import QPalette
from PyQt6.QtCore import Qt
def set_light_mode(app: QApplication):
app.setStyle("Fusion")
app.setPalette(app.style().standardPalette())Of course we cannot use PyQt6 directly but you get the idea. Make a function that allows setting dark mode after instantiating the app. Perhaps this needs to be in silx.
Ping @t20100
|
The problem is that app.setStyle("Fusion")will not work alone - setting "fusion" without disabling
the app.styleHints().setColorScheme(qt.Qt.ColorScheme.Light)do not exist in PySide6==6.7.3 and require higher version - which leads to another visual bugs #1182 #1179 |
I just dropped some code to help. I have no idea either. My point was: would it be possible to set the app to light-mode after instantiation and not use environment variables? I don't understand what this "fusion" business is either. |
|
| would it be possible to set the app to light-mode after instantiation Quick test with silx view & PySide 6.10.2 on Linux: |
|
I would assume this PR as a hot fix for Windows The proper solution is to fix hardcoded colors in the way suggested by @t20100 and then there will be no need neither for Pyside6==6.7.3 nor for forcing We can also decide that |
|
To summarize the patch:
|
|
I still do not fully understand Qt's styles/palettes
setColorScheme is Qt6-only. It does not affect Windows dark title bars at the OS level. 🤯 |
|
Btw I was told VISA has dark-mode by default now. |
|
It looks to me there are unresolved comments. Ideally I would expect light mode forced unless the user has explicitly asked dark mode. I guess the comment of @woutdenolf was in that direction but not implemented. Could it be? I am fine forcing light mode in the mean time too, but the comments should be resolved. |
|
The Platform/Style/Palette discussion is a complicated one. I agreed with Sergej that we can enforce light mode on Windows for the next patch release. There is no point in allowing dark mode anyway, the GUI would become basically unusable. Afterwards we can discuss a common approach to this in pymca and other tools like silx. |
|
i will merge after MacOS patch #1185 |
Closes #1178
By forcing
Lightmode.Actually it should probably also fix the issue related to use of different PySide6 version - because it force to use a standard them instead of implementing user windows settings (default windows behavior) - yes maybe it makes things to look more "old style" but fully visible and functional.