mirror of
https://github.com/zealdocs/zeal.git
synced 2024-10-26 17:22:47 +03:00
feat(ui): use Fusion style on Windows 10 & 11 (#1495)
This enables dark mode support. Fixes #811.
This commit is contained in:
parent
b5ca9e70dd
commit
a524735129
@ -189,6 +189,16 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
|
||||
// Use Fusion style on Windows 10 & 11. This enables proper darl mode support.
|
||||
// See https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5.
|
||||
// TODO: Make style configurable, detect -style argument.
|
||||
#if defined(Q_OS_WIN) && (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||
const auto osName = QSysInfo::prettyProductName();
|
||||
if (osName.startsWith("Windows 10") || osName.startsWith("Windows 11")) {
|
||||
QApplication::setStyle("fusion");
|
||||
}
|
||||
#endif
|
||||
|
||||
QScopedPointer<QApplication> qapp(new QApplication(argc, argv));
|
||||
|
||||
const CommandLineParameters clParams = parseCommandLine(qapp->arguments());
|
||||
|
Loading…
Reference in New Issue
Block a user