diff --git a/OpenRGB.pro b/OpenRGB.pro index 3d382701..10876f6a 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -195,6 +195,7 @@ HEADERS += qt/OpenRGBSoftwareInfoPage.h \ qt/OpenRGBSupportedDevicesPage.h \ qt/OpenRGBSystemInfoPage.h \ + qt/OpenRGBThemeManager.h \ qt/OpenRGBZoneResizeDialog.h \ qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsEntry.h \ qt/OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.h \ @@ -575,6 +576,7 @@ SOURCES += qt/OpenRGBSoftwareInfoPage.cpp \ qt/OpenRGBSupportedDevicesPage.cpp \ qt/OpenRGBSystemInfoPage.cpp \ + qt/OpenRGBThemeManager.cpp \ qt/OpenRGBZoneResizeDialog.cpp \ qt/OpenRGBZonesBulkResizer.cpp \ qt/TabLabel.cpp \ diff --git a/PluginManager.cpp b/PluginManager.cpp index f430a203..d900f7d4 100644 --- a/PluginManager.cpp +++ b/PluginManager.cpp @@ -1,12 +1,12 @@ #include "LogManager.h" #include "PluginManager.h" +#include "OpenRGBThemeManager.h" -PluginManager::PluginManager(bool dark_theme_val) +PluginManager::PluginManager() { /*---------------------------------------------------------*\ | Initialize plugin manager class variables | \*---------------------------------------------------------*/ - dark_theme = dark_theme_val; AddPluginCallbackVal = nullptr; AddPluginCallbackArg = nullptr; RemovePluginCallbackVal = nullptr; @@ -259,6 +259,8 @@ void PluginManager::LoadPlugin(std::string path) QObject* instance = ActivePlugins[plugin_idx].loader->instance(); + bool dark_theme = OpenRGBThemeManager::IsDarkTheme(); + if(instance) { OpenRGBPluginInterface* plugin = qobject_cast(instance); diff --git a/PluginManager.h b/PluginManager.h index 53db9afd..600f8d94 100644 --- a/PluginManager.h +++ b/PluginManager.h @@ -29,7 +29,7 @@ typedef void (*RemovePluginCallback)(void *, OpenRGBPluginEntry* plugin); class PluginManager { public: - PluginManager(bool dark_theme); + PluginManager(); void RegisterAddPluginCallback(AddPluginCallback new_callback, void * new_callback_arg); void RegisterRemovePluginCallback(RemovePluginCallback new_callback, void * new_callback_arg); @@ -47,8 +47,6 @@ public: std::vector ActivePlugins; private: - bool dark_theme; - AddPluginCallback AddPluginCallbackVal; void * AddPluginCallbackArg; diff --git a/qt/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2.cpp index 11364f9f..9462de3c 100644 --- a/qt/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2.cpp @@ -11,16 +11,13 @@ #include "ResourceManager.h" #include "TabLabel.h" #include "OpenRGBZonesBulkResizer.h" +#include "OpenRGBThemeManager.h" #include #include #include #include #include -#ifdef _WIN32 -#include -#endif - using namespace Ui; static QString GetIconString(device_type type, bool dark) @@ -132,60 +129,6 @@ static void DialogShowCallback(void * this_ptr, PLogMessage msg) QMetaObject::invokeMethod(this_obj, "onShowDialogMessage", Qt::QueuedConnection); } -bool OpenRGBDialog2::IsDarkTheme() - { -#ifdef _WIN32 - /*-------------------------------------------------*\ - | Windows dark theme settings | - \*-------------------------------------------------*/ - json theme_settings; - - /*-------------------------------------------------*\ - | Get prefered theme from settings manager | - \*-------------------------------------------------*/ - theme_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Theme"); - - /*-------------------------------------------------*\ - | Read the theme key and adjust accordingly | - \*-------------------------------------------------*/ - std::string current_theme = "light"; - - if(theme_settings.contains("theme")) - { - current_theme = theme_settings["theme"]; - } - - if((current_theme == "auto") || (current_theme == "dark")) - { - if(current_theme == "auto") - { - QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat); - - if(settings.value("AppsUseLightTheme") != 0) - { - return false; - } - else if(settings.value("AppsUseLightTheme") == 0) - { - return true; - } - } - else if(current_theme == "dark") - { - return true; - } - } - return false; - -#else - if(QPalette().window().color().value() < 127) - { - return true; - } -#endif - - return false; -} bool OpenRGBDialog2::IsMinimizeOnClose() { @@ -386,30 +329,7 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op trayIcon->setContextMenu(trayIconMenu); trayIcon->show(); -#ifdef _WIN32 - /*-------------------------------------------------*\ - | Apply dark theme on Windows if configured | - \*-------------------------------------------------*/ - if(IsDarkTheme()) - { - QPalette pal = palette(); - pal.setColor(QPalette::WindowText, Qt::white); - pal.setColor(QPalette::Link, QColor(0,127,220)); - pal.setColor(QPalette::LinkVisited, QColor(64,196,220)); - QApplication::setPalette(pal); - QFile darkTheme(":/windows_dark.qss"); - darkTheme.open(QFile::ReadOnly); - setStyleSheet(darkTheme.readAll()); - } -#endif - -#ifdef __APPLE__ - /*-------------------------------------------------*\ - | Apply Qt Fusion theme on MacOS, as the MacOS | - | default theme does not handle vertical tabs well | - \*-------------------------------------------------*/ - QApplication::setStyle(QStyleFactory::create("Fusion")); -#endif + OpenRGBThemeManager::Init(); /*-----------------------------------------------------*\ | Update the profile list | @@ -450,7 +370,7 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op /*-----------------------------------------------------*\ | Initialize the plugin manager | \*-----------------------------------------------------*/ - plugin_manager = new PluginManager(IsDarkTheme()); + plugin_manager = new PluginManager(); plugin_manager->RegisterAddPluginCallback(&CreatePluginCallback, this); plugin_manager->RegisterRemovePluginCallback(&DeletePluginCallback, this); plugin_manager->ScanAndLoadPlugins(); @@ -585,7 +505,7 @@ void OpenRGBDialog2::AddPluginsPage() QString PluginsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { PluginsLabelString = "plugin_dark.png"; } @@ -613,7 +533,7 @@ void OpenRGBDialog2::AddSoftwareInfoPage() QString SoftwareLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SoftwareLabelString = "software_dark.png"; } @@ -641,7 +561,7 @@ void OpenRGBDialog2::AddSupportedDevicesPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "software_dark.png"; } @@ -670,7 +590,7 @@ void OpenRGBDialog2::AddSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "settings_dark.png"; } @@ -698,7 +618,7 @@ void OpenRGBDialog2::AddE131SettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "wireless_dark.png"; } @@ -726,7 +646,7 @@ void OpenRGBDialog2::AddLIFXSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "light_dark.png"; } @@ -754,7 +674,7 @@ void OpenRGBDialog2::AddPhilipsHueSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "light_dark.png"; } @@ -782,7 +702,7 @@ void OpenRGBDialog2::AddPhilipsWizSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "light_dark.png"; } @@ -810,7 +730,7 @@ void OpenRGBDialog2::AddQMKORGBSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "keyboard_dark.png"; } @@ -838,7 +758,7 @@ void OpenRGBDialog2::AddSerialSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "serial_dark.png"; } @@ -866,7 +786,7 @@ void OpenRGBDialog2::AddYeelightSettingsPage() QString SettingsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SettingsLabelString = "light_dark.png"; } @@ -896,7 +816,7 @@ void OpenRGBDialog2::AddPlugin(OpenRGBPluginEntry* plugin) \*-----------------------------------------------------*/ QString PluginLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { PluginLabelString = "plugin_dark.png"; } @@ -1080,7 +1000,7 @@ void OpenRGBDialog2::AddI2CToolsPage() QString SMBusToolsLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { SMBusToolsLabelString = "tools_dark.png"; } @@ -1211,7 +1131,7 @@ void OpenRGBDialog2::UpdateDevicesList() /*-----------------------------------------------------*\ | Create the tab label | \*-----------------------------------------------------*/ - TabLabel* NewTabLabel = new TabLabel(GetIconString(controllers[controller_idx]->type, IsDarkTheme()), QString::fromStdString(controllers[controller_idx]->name)); + TabLabel* NewTabLabel = new TabLabel(GetIconString(controllers[controller_idx]->type, OpenRGBThemeManager::IsDarkTheme()), QString::fromStdString(controllers[controller_idx]->name)); ui->DevicesTabBar->tabBar()->setTabButton(ui->DevicesTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel); ui->DevicesTabBar->tabBar()->setTabToolTip(ui->DevicesTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->name)); @@ -1262,7 +1182,7 @@ void OpenRGBDialog2::UpdateDevicesList() /*-----------------------------------------------------*\ | Create the tab label | \*-----------------------------------------------------*/ - TabLabel* NewTabLabel = new TabLabel(GetIconString(controllers[controller_idx]->type, IsDarkTheme()), QString::fromStdString(controllers[controller_idx]->name)); + TabLabel* NewTabLabel = new TabLabel(GetIconString(controllers[controller_idx]->type, OpenRGBThemeManager::IsDarkTheme()), QString::fromStdString(controllers[controller_idx]->name)); ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel); ui->InformationTabBar->tabBar()->setTabToolTip(ui->InformationTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->name)); @@ -1499,16 +1419,6 @@ void OpenRGBDialog2::onShowDialogMessage() QMessageBox box; - if(IsDarkTheme()) - { - QPalette pal = palette(); - pal.setColor(QPalette::WindowText, Qt::white); - box.setPalette(pal); - QFile darkTheme(":/windows_dark.qss"); - darkTheme.open(QFile::ReadOnly); - box.setStyleSheet(darkTheme.readAll()); - } - box.setInformativeText(dialog_message); QCheckBox* CheckBox_DontShowAgain = new QCheckBox("Don't show this message again"); @@ -1868,7 +1778,7 @@ void Ui::OpenRGBDialog2::AddConsolePage() QString ConsoleLabelString; - if(IsDarkTheme()) + if(OpenRGBThemeManager::IsDarkTheme()) { ConsoleLabelString = "console_dark.png"; } diff --git a/qt/OpenRGBDialog2.h b/qt/OpenRGBDialog2.h index 8a4c354d..c015ef84 100644 --- a/qt/OpenRGBDialog2.h +++ b/qt/OpenRGBDialog2.h @@ -55,7 +55,6 @@ public: void setMode(unsigned char mode_val); - static bool IsDarkTheme(); static bool IsMinimizeOnClose(); void SetDialogMessage(PLogMessage msg); diff --git a/qt/OpenRGBProfileSaveDialog.cpp b/qt/OpenRGBProfileSaveDialog.cpp index ccde3709..01a690cd 100644 --- a/qt/OpenRGBProfileSaveDialog.cpp +++ b/qt/OpenRGBProfileSaveDialog.cpp @@ -11,22 +11,6 @@ Ui::OpenRGBProfileSaveDialog::OpenRGBProfileSaveDialog(QWidget *parent) : QDialog(parent), ui(new Ui::OpenRGBProfileSaveDialogUi) { - #ifdef _WIN32 - bool DarkTheme = OpenRGBDialog2::IsDarkTheme(); - /*-------------------------------------------------*\ - | Apply dark theme on Windows if configured | - \*-------------------------------------------------*/ - if(DarkTheme) - { - darkTheme = 1; - QPalette pal = palette(); - pal.setColor(QPalette::WindowText, Qt::white); - QApplication::setPalette(pal); - QFile darkTheme(":/windows_dark.qss"); - darkTheme.open(QFile::ReadOnly); - setStyleSheet(darkTheme.readAll()); - } - #endif ui->setupUi(this); } diff --git a/qt/OpenRGBProfileSaveDialog.h b/qt/OpenRGBProfileSaveDialog.h index f7eebc65..3bcdfc24 100644 --- a/qt/OpenRGBProfileSaveDialog.h +++ b/qt/OpenRGBProfileSaveDialog.h @@ -22,7 +22,6 @@ public: private: Ui::OpenRGBProfileSaveDialogUi *ui; - bool darkTheme = false; }; #endif // OPENRGBPROFILESAVEDIALOG_H diff --git a/qt/OpenRGBSettingsPage.cpp b/qt/OpenRGBSettingsPage.cpp index c24b34d0..4c499b62 100644 --- a/qt/OpenRGBSettingsPage.cpp +++ b/qt/OpenRGBSettingsPage.cpp @@ -14,9 +14,8 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) : ui->setupUi(this); /*---------------------------------------------------------*\ - | Load theme settings (Windows only) | + | Load theme settings | \*---------------------------------------------------------*/ -#ifdef _WIN32 ui->ComboBoxTheme->addItems({"auto", "light", "dark"}); json theme_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Theme"); @@ -32,10 +31,6 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) : } theme_initialized = true; -#else - ui->ComboBoxTheme->hide(); - ui->ThemeLabel->hide(); -#endif /*---------------------------------------------------------*\ | Load user interface settings | diff --git a/qt/OpenRGBThemeManager.cpp b/qt/OpenRGBThemeManager.cpp new file mode 100644 index 00000000..921ec4e0 --- /dev/null +++ b/qt/OpenRGBThemeManager.cpp @@ -0,0 +1,117 @@ +#include "OpenRGBThemeManager.h" +#include "ResourceManager.h" +#include "PluginManager.h" +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#include +#endif + +void OpenRGBThemeManager::Init() +{ + +#ifdef __APPLE__ + /*-------------------------------------------------*\ + | Apply Qt Fusion theme on MacOS, as the MacOS | + | default theme does not handle vertical tabs well | + \*-------------------------------------------------*/ + QApplication::setStyle(QStyleFactory::create("Fusion")); +#else + /*---------------------------------------------------*\ + | Apply dark theme on Windows and Linux if configured | + \*---------------------------------------------------*/ + if(IsDarkTheme()) + { + SetDarkTheme(); + } +#endif + +} + +void OpenRGBThemeManager::SetDarkTheme() +{ + QPalette pal; + + pal.setColor(QPalette::WindowText, Qt::white); + pal.setColor(QPalette::Link, QColor(0,127,220)); + pal.setColor(QPalette::LinkVisited, QColor(64,196,220)); + pal.setColor(QPalette::Window, QColor(53,53,53)); + pal.setColor(QPalette::Base, QColor(42,42,42)); + pal.setColor(QPalette::AlternateBase, QColor(66,66,66)); + pal.setColor(QPalette::ToolTipBase, Qt::white); + pal.setColor(QPalette::ToolTipText, Qt::white); + pal.setColor(QPalette::Text, Qt::white); + pal.setColor(QPalette::Dark, QColor(35,35,35)); + pal.setColor(QPalette::Shadow, QColor(20,20,20)); + pal.setColor(QPalette::Button, QColor(53,53,53)); + pal.setColor(QPalette::ButtonText, Qt::white); + pal.setColor(QPalette::BrightText, Qt::red); + pal.setColor(QPalette::Highlight, QColor(42,130,218)); + pal.setColor(QPalette::HighlightedText, Qt::white); + + pal.setColor(QPalette::Disabled, QPalette::Text, QColor(127,127,127)); + pal.setColor(QPalette::Disabled, QPalette::WindowText, QColor(127,127,127)); + pal.setColor(QPalette::Disabled, QPalette::Highlight, QColor(80,80,80) ); + pal.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(127,127,127)); + pal.setColor(QPalette::Disabled, QPalette::HighlightedText, QColor(127,127,127)); + pal.setColor(QPalette::Disabled, QPalette::Text, QColor(127,127,127)); + pal.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(127,127,127)); + +#ifdef _WIN32 + QApplication::setStyle(QStyleFactory::create("Fusion")); +#endif + + QApplication::setPalette(pal); +} + +bool OpenRGBThemeManager::IsDarkTheme() +{ + + /*-------------------------------------------------*\ + | Dark theme settings | + \*-------------------------------------------------*/ + json theme_settings; + + /*-------------------------------------------------*\ + | Get prefered theme from settings manager | + \*-------------------------------------------------*/ + theme_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Theme"); + + /*-------------------------------------------------*\ + | Read the theme key and adjust accordingly | + \*-------------------------------------------------*/ + std::string current_theme = "light"; + + if(theme_settings.contains("theme")) + { + current_theme = theme_settings["theme"]; + } + + if(current_theme == "dark") + { + return true; + } +#ifdef _WIN32 + else if(current_theme == "auto") + { + QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat); + + if(settings.value("AppsUseLightTheme") != 0) + { + return false; + } + else + { + return true; + } + } + + return false; +#endif + + return false; +} diff --git a/qt/OpenRGBThemeManager.h b/qt/OpenRGBThemeManager.h new file mode 100644 index 00000000..f885338d --- /dev/null +++ b/qt/OpenRGBThemeManager.h @@ -0,0 +1,14 @@ +#ifndef OPENRGBTHEMEMANAGER_H +#define OPENRGBTHEMEMANAGER_H + +#include + +class OpenRGBThemeManager +{ +public: + static void Init(); + static void SetDarkTheme(); + static bool IsDarkTheme(); +}; + +#endif // OPENRGBTHEMEMANAGER_H diff --git a/qt/OpenRGBZonesBulkResizer.cpp b/qt/OpenRGBZonesBulkResizer.cpp index f3bb05a4..23cd23a4 100644 --- a/qt/OpenRGBZonesBulkResizer.cpp +++ b/qt/OpenRGBZonesBulkResizer.cpp @@ -65,17 +65,6 @@ void OpenRGBZonesBulkResizer::RunChecks(QWidget *parent) QDialog* dialog = new QDialog(parent); dialog->setWindowTitle("Resize the zones"); - if (OpenRGBDialog2::IsDarkTheme()) - { - QPalette pal; - pal.setColor(QPalette::WindowText, Qt::white); - dialog->setPalette(pal); - QFile dark_theme(":/windows_dark.qss"); - dark_theme.open(QFile::ReadOnly); - dialog->setStyleSheet(dark_theme.readAll()); - dark_theme.close(); - } - dialog->setMinimumSize(600,480); dialog->setModal(true); diff --git a/qt/resources.qrc b/qt/resources.qrc index ba8ec8c7..6d3f91db 100644 --- a/qt/resources.qrc +++ b/qt/resources.qrc @@ -29,7 +29,6 @@ gamepad_dark.png light.png light_dark.png - windows_dark.qss arrow-down.png arrow-up.png plugin.png diff --git a/qt/windows_dark.qss b/qt/windows_dark.qss deleted file mode 100644 index 3774fb71..00000000 --- a/qt/windows_dark.qss +++ /dev/null @@ -1,332 +0,0 @@ -QMainWindow -{ - background-color: #5c5c5c; - color: white; -} - -QLabel -{ - color: white; -} - -/* External QTabWidget */ - -QTabBar -{ - background-color: #5c5c5c; -} - -QTabBar::tab -{ - background-color: #5c5c5c; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 12px; - padding-right: 12px; - border: 1px solid #2e2e2e; - margin-right: 1px; -} - -QTabBar::tab:selected -{ - background-color: #454545; - border: 1px solid #2e2e2e; - border-bottom: 1px solid #191919; -} - -QTabBar::tab:hover -{ - background-color: #757575; - border: 1px solid #404040; -} - -QTabWidget::pane -{ - /* This is the housing for all of the tabs*/ - background-color: #5c5c5c; - border: 1px solid #2e2e2e; - position: absolute; - top: -1px; -} - -/* Internal QTabWidget */ - -QTabWidget::pane QTabBar -{ - background-color: #5c5c5c; - border-right: 1px solid #2e2e2e; -} - -QTabWidget QWidget QTabBar::tab -{ - background-color: #5c5c5c; - padding-top: 4px; - padding-bottom: 5px; - height: 50px; - border: 10px; - border: 1px solid #5c5c5c; - border-right: 1px solid #2e2e2e; - margin-right: 0px; -} - -QTabWidget QWidget QTabBar::tab:!selected -{ - background-color: #5c5c5c; - border-right: 1px solid #2e2e2e; - border-left: 1px solid #2e2e2e; - border-top: 1px solid #2e2e2e; -} - -QTabWidget QWidget QTabBar::tab:selected -{ - background-color: #454545; - border: 1px solid #2e2e2e; - border-right: 1px solid #454545; -} - -QTabWidget QWidget QTabBar::tab:last:!selected -{ - background-color: #5c5c5c; - border: 1px solid #2e2e2e; -} - -QTabWidget QWidget QTabBar::tab:hover -{ - background-color: #757575; - border: 1px solid #5c5c5c; - border-right: 1px solid #2e2e2e; -} - -QTabWidget QWidget QTabBar::tab:last:hover -{ - background-color: #757575; - border: 1px solid #5c5c5c; - border-right: 1px solid #2e2e2e; -} - -QTabWidget QWidget QTabWidget::pane /* The contents of the tab (colors, modes, leds, etc.) */ -{ - background-color: #454545; - border-top: 1px solid #2e2e2e; - border: 1px solid #2e2e2e; - position: absolute; - top: 0px; - left: -1px; -} - -/* QDialog boxes */ - -QDialog::QWidget -{ - background: #454545; - background-color: #454545; - color: white; -} - -QDialog QWidget::QDialogButtonBox -{ - background-color: #454545; - color: white; -} - -QDialog QWidget::QLabel -{ - background-color: #454545; - color: white; -} - -QDialog QWidget::QLineEdit -{ - background-color: #454545; - color: white; -} - -/* Buttons and combo boxes */ - -QPushButton, QToolButton -{ - padding: 3px; - background-color: #404040; - border: 1px solid #2e2e2e; - color: white; -} - -QToolButton:hover -{ - background-color: #454545; -} - -QMenu -{ - background-color: #404040; - border: 1px solid #2e2e2e; - color: white; -} - -QMenu::item:selected -{ - background-color: #454545; -} - -QComboBox -{ - padding: 1px; - background-color: #404040; - border: 1px solid #2e2e2e; - color: white; -} - -QComboBox QAbstractItemView -{ - background-color: #404040; - color: white; - border: 1px solid #2e2e2e; - selection-background-color: #303030; -} - -QScrollBar:vertical -{ - background: #454545; - border: 0px; - margin: 0px 0px; - width: 15px; -} - -/* Arrow images -QScrollBar::up-arrow -{ - image: url(":/arrow-up.png"); -} - -QScrollBar::down-arrow -{ - image: url(":/arrow-down.png"); -} */ - -QScrollBar::handle:vertical -{ - background-color: #454545; -} - -QScrollBar::handle:vertical:hover -{ - background-color: #757575; -} - -QComboBox::drop-down -{ - border: 0px; -} - -QComboBox::down-arrow -{ - image: url(":/arrow-down.png"); -} - -QPushButton:!disabled:hover, QComboBox:!disabled:hover -{ - background-color: #4F4F4F; -} - - -QComboBox QAbstractItemView QScrollBar::handle:hover -{ - background-color: #7A7A7A; -} - -QPushButton:!disabled:hover, QComboBox:!disabled:hover -{ - background-color: #4F4F4F; -} - -QPushButton:disabled, QComboBox:disabled -{ - background-color: #404040; - color: #5B5B5B; -} - -QPushButton:flat -{ - border: 0px; -} - -QRadioButton -{ - color: white; -} - -QRadioButton::disabled -{ - color: #5B5B5B; -} - -/* Line edits and block edits */ - -QLineEdit, QSpinBox -{ - background-color: #4F4F4F; - border: 1px solid #5B5B5B; - color: white; - padding: 1px; -} - -QTreeView -{ - background-color: #5c5c5c; - color: white; -} - -QHeaderView::section -{ - background-color: #454545; - color: white; -} - -QPlainTextEdit, QTextEdit -{ - background: #454545; - color: white; -} - -/* QProgressBar and QSlider */ - -QProgressBar -{ - border: 1px solid #2e2e2e; - background-color: #404040; - color: white; -} - -QDialog -{ - background-color: #5c5c5c -} - -/* QTableWidgets */ - -QTableView, QTableWidget, QTableWidget * -{ - background-color: #454545; - color: white; -} - -QTableWidget QTableCornerButton::section -{ - background-color: #444444; -} - -/* QScrollAreas */ - -QScrollArea QWidget -{ - background-color: #5c5c5c; - color: white; -} - -/* QListWidgets */ - -QListWidget -{ - background-color: #5c5c5c; - color: white; -}