Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): use Fusion style on Windows 10 & 11 #1495

Merged
merged 1 commit into from
Apr 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down