mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
parent
2d857b6200
commit
2d185dc1c7
8 changed files with 106 additions and 28 deletions
|
@ -37,6 +37,10 @@
|
|||
#include <QStyle>
|
||||
#include <QStyleHints>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QOperatingSystemVersion>
|
||||
#endif
|
||||
|
||||
#include "base/global.h"
|
||||
#include "base/logger.h"
|
||||
#include "base/path.h"
|
||||
|
@ -80,6 +84,12 @@ UIThemeManager::UIThemeManager()
|
|||
, m_useSystemIcons {Preferences::instance()->useSystemIcons()}
|
||||
#endif
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
const QString defaultStyle = (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10) ? u"Fusion"_s : QString();
|
||||
if (const QString styleName = Preferences::instance()->getStyle(); !QApplication::setStyle(styleName.isEmpty() ? defaultStyle : styleName))
|
||||
LogMsg(tr("Set app style failed. Unknown style: \"%1\"").arg(styleName), Log::WARNING);
|
||||
#endif
|
||||
|
||||
// NOTE: Qt::QueuedConnection can be omitted as soon as support for Qt 6.5 is dropped
|
||||
connect(QApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, &UIThemeManager::onColorSchemeChanged, Qt::QueuedConnection);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue