View Single Post
Old 09-21-2024, 10:19 AM   #18
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,652
Karma: 205022288
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Also for the record... from Qt6.5 on, there's no need to do much of anything special for plugins to match the system colors/theme. Just add app.setStyle('Fusion') somewhere appropriate and your plugin will match your system colors/theme (and will even change on the "fly"). To my knowledge, system theme matching has worked with PySide6 apps on Linux and macOS without needing to specify app.setStyle('Fusion') for some time (Fusion is default on Linux, and macOS uses a different dark capable theme). But it's definitely still needed on Windows (which defaults to another style).

There should be no need to check for a system dark theme on any platform. If you make Sigil 2.0 the minimum for your plugin, you should be able to just add app.SetSyle('Fusion') to your code and PySide6 theming (including on the fly theming) will take care of itself. I wouldn't set the style to Fusion on macOS, but something like the following should work across the board:

Code:
_plat = sys.platform.lower()
iswindows = 'win32' in _plat or 'win64' in _plat
if iswindows:
  app.setStyle('Fusion')
I bypassed the match_dark_palette feature of my plugin_utils module and this just works on all platforms. So no need to use my module just to match system themes.

Last edited by DiapDealer; 09-21-2024 at 10:48 AM.
DiapDealer is online now   Reply With Quote