Browse Source

Merge pull request #13220 from jagannatharjun/fix-style

Fix style
adaptive-webui-19844
Mike Tzou 4 years ago committed by GitHub
parent
commit
8ff4374325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/app/application.cpp
  2. 2
      src/gui/statusbar.cpp
  3. 6
      src/gui/uithememanager.cpp
  4. 3
      src/gui/uithememanager.h

1
src/app/application.cpp

@ -615,7 +615,6 @@ int Application::exec(const QStringList &params) @@ -615,7 +615,6 @@ int Application::exec(const QStringList &params)
#else
UIThemeManager::initInstance();
m_window = new MainWindow;
UIThemeManager::instance()->applyStyleSheet();
#endif // DISABLE_GUI
m_running = true;

2
src/gui/statusbar.cpp

@ -49,7 +49,7 @@ StatusBar::StatusBar(QWidget *parent) @@ -49,7 +49,7 @@ StatusBar::StatusBar(QWidget *parent)
#ifndef Q_OS_MACOS
// Redefining global stylesheet breaks certain elements on mac like tabs.
// 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
BitTorrent::Session *const session = BitTorrent::Session::instance();

6
src/gui/uithememanager.cpp

@ -88,6 +88,7 @@ UIThemeManager::UIThemeManager() @@ -88,6 +88,7 @@ UIThemeManager::UIThemeManager()
else {
loadColorsFromJSONConfig();
applyPalette();
applyStyleSheet();
}
}
}
@ -99,11 +100,6 @@ UIThemeManager *UIThemeManager::instance() @@ -99,11 +100,6 @@ UIThemeManager *UIThemeManager::instance()
void UIThemeManager::applyStyleSheet() const
{
if (!m_useCustomTheme) {
qApp->setStyleSheet({});
return;
}
QFile qssFile(":uitheme/stylesheet.qss");
if (!qssFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qApp->setStyleSheet({});

3
src/gui/uithememanager.h

@ -45,8 +45,6 @@ public: @@ -45,8 +45,6 @@ public:
static void freeInstance();
static UIThemeManager *instance();
void applyStyleSheet() const;
QString getIconPath(const QString &iconId) const;
QIcon getIcon(const QString &iconId, const QString &fallback = {}) const;
QIcon getFlagIcon(const QString &countryIsoCode) const;
@ -58,6 +56,7 @@ private: @@ -58,6 +56,7 @@ private:
QString getIconPathFromResources(const QString &iconId, const QString &fallback = {}) const;
void loadColorsFromJSONConfig();
void applyPalette() const;
void applyStyleSheet() const;
static UIThemeManager *m_instance;
QHash<QString, QColor> m_colors;

Loading…
Cancel
Save