mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-10 20:31:47 +00:00
commit
8ff4374325
@ -615,7 +615,6 @@ int Application::exec(const QStringList ¶ms)
|
|||||||
#else
|
#else
|
||||||
UIThemeManager::initInstance();
|
UIThemeManager::initInstance();
|
||||||
m_window = new MainWindow;
|
m_window = new MainWindow;
|
||||||
UIThemeManager::instance()->applyStyleSheet();
|
|
||||||
#endif // DISABLE_GUI
|
#endif // DISABLE_GUI
|
||||||
|
|
||||||
m_running = true;
|
m_running = true;
|
||||||
|
@ -49,7 +49,7 @@ StatusBar::StatusBar(QWidget *parent)
|
|||||||
#ifndef Q_OS_MACOS
|
#ifndef Q_OS_MACOS
|
||||||
// Redefining global stylesheet breaks certain elements on mac like tabs.
|
// Redefining global stylesheet breaks certain elements on mac like tabs.
|
||||||
// Qt checks whether the stylesheet class inherts("QMacStyle") and this becomes false.
|
// Qt checks whether the stylesheet class inherts("QMacStyle") and this becomes false.
|
||||||
qApp->setStyleSheet("QStatusBar::item { border-width: 0; }");
|
setStyleSheet("QStatusBar::item { border-width: 0; }");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BitTorrent::Session *const session = BitTorrent::Session::instance();
|
BitTorrent::Session *const session = BitTorrent::Session::instance();
|
||||||
|
@ -88,6 +88,7 @@ UIThemeManager::UIThemeManager()
|
|||||||
else {
|
else {
|
||||||
loadColorsFromJSONConfig();
|
loadColorsFromJSONConfig();
|
||||||
applyPalette();
|
applyPalette();
|
||||||
|
applyStyleSheet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,11 +100,6 @@ UIThemeManager *UIThemeManager::instance()
|
|||||||
|
|
||||||
void UIThemeManager::applyStyleSheet() const
|
void UIThemeManager::applyStyleSheet() const
|
||||||
{
|
{
|
||||||
if (!m_useCustomTheme) {
|
|
||||||
qApp->setStyleSheet({});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QFile qssFile(":uitheme/stylesheet.qss");
|
QFile qssFile(":uitheme/stylesheet.qss");
|
||||||
if (!qssFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!qssFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
qApp->setStyleSheet({});
|
qApp->setStyleSheet({});
|
||||||
|
@ -45,8 +45,6 @@ public:
|
|||||||
static void freeInstance();
|
static void freeInstance();
|
||||||
static UIThemeManager *instance();
|
static UIThemeManager *instance();
|
||||||
|
|
||||||
void applyStyleSheet() const;
|
|
||||||
|
|
||||||
QString getIconPath(const QString &iconId) const;
|
QString getIconPath(const QString &iconId) const;
|
||||||
QIcon getIcon(const QString &iconId, const QString &fallback = {}) const;
|
QIcon getIcon(const QString &iconId, const QString &fallback = {}) const;
|
||||||
QIcon getFlagIcon(const QString &countryIsoCode) const;
|
QIcon getFlagIcon(const QString &countryIsoCode) const;
|
||||||
@ -58,6 +56,7 @@ private:
|
|||||||
QString getIconPathFromResources(const QString &iconId, const QString &fallback = {}) const;
|
QString getIconPathFromResources(const QString &iconId, const QString &fallback = {}) const;
|
||||||
void loadColorsFromJSONConfig();
|
void loadColorsFromJSONConfig();
|
||||||
void applyPalette() const;
|
void applyPalette() const;
|
||||||
|
void applyStyleSheet() const;
|
||||||
|
|
||||||
static UIThemeManager *m_instance;
|
static UIThemeManager *m_instance;
|
||||||
QHash<QString, QColor> m_colors;
|
QHash<QString, QColor> m_colors;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user