Skip to content

Enable Dark Theme for Titlebar in Windows

When using the windows dark theme it's annoying to have white titlebars on some apps. I noticed that this app which and I would like to use on Windows but the lack of dark theme on the titlebar makes it not fit in well. I did some research on this and found that the best way to set it seems to be using the darkmode toggle on the platform. That can be set as a parameter or environment variable. This seems to be the easiest way to set it. I tested this locally on a Win11 VM and it looks to work the same as setting -platform windows:darkmode=1 or setting QT_QPA_PLATFORM=windows:darkmode=1. Note this does need to be set before the QApplication is originally created and so I think it has to be done per app to work. If I missed some other way to set this that would be better I would be interested to know more.

QT Docs: https://doc.qt.io/qt-5/qguiapplication.html#platform-specific-arguments

Edited by Nicholas Omann

Merge request reports

Loading