1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-03-09 11:51:03 +00:00

Use Fusion style on Windows 10+

PR .
This commit is contained in:
Vladimir Golovnev 2023-09-18 08:38:35 +03:00 committed by GitHub
parent dcba9eda00
commit 5a334175a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
/* /*
* Bittorrent Client using Qt and libtorrent. * Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2014 Vladimir Golovnev <glassez@yandex.ru> * Copyright (C) 2014-2023 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org> * Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -59,6 +59,10 @@
#include <QSplashScreen> #include <QSplashScreen>
#include <QTimer> #include <QTimer>
#ifdef Q_OS_WIN
#include <QOperatingSystemVersion>
#endif
#ifdef QBT_STATIC_QT #ifdef QBT_STATIC_QT
#include <QtPlugin> #include <QtPlugin>
Q_IMPORT_PLUGIN(QICOPlugin) Q_IMPORT_PLUGIN(QICOPlugin)
@ -104,7 +108,12 @@ int main(int argc, char *argv[])
#endif #endif
// We must save it here because QApplication constructor may change it // We must save it here because QApplication constructor may change it
bool isOneArg = (argc == 2); const bool isOneArg = (argc == 2);
#if !defined(DISABLE_GUI) && defined(Q_OS_WIN)
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10)
QApplication::setStyle(u"Fusion"_s);
#endif
// `app` must be declared out of try block to allow display message box in case of exception // `app` must be declared out of try block to allow display message box in case of exception
std::unique_ptr<Application> app; std::unique_ptr<Application> app;