Help making a Dark Mode #2


(Morgan Reed) #1

So, I’ve made a “dark mode” (Only has a Windows executable as of right now), but for some reason, i am unable to change the color of the window header of the dockable widgets. Is there a way to do this? Also, is there a way to add a specific file that could change the QPalette of each dockable widget instead of changing each file individually? I would like to create a “select theme” widget to let the user select a pre-determined color theme

(Download: https://drive.google.com/open?id=1SghFrV5iT9yapwx3DVv1kiuNZE42RaeU)


(Jose Moreno) #2

@velocireed This is a long standing issue. apparently there’s no easy way to have a functional dark mode for windows please see this issue to learn more about it: https://github.com/pencil2d/pencil/issues/550


(Morgan Reed) #3

Ah. I see. Well, thanks anyways


(scribblemaniac) #4

@velocireed You should be using QApplication::setPalette rather than setting each widget individually. To change the headers you’ve circled, you can use the QDockWidget::title CSS selector, see the changes we made to basedockwidget.cpp here. Also Windows 10 does appear to have some darkmode support, so you should try using that first: https://www.cnet.com/how-to/how-to-enable-dark-mode-in-windows-10/.