diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 20ce52253..35d92be3d 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -66,7 +66,8 @@ public: BoolSetting showTitle = {"/appearance/splitheader/showTitle", false}; BoolSetting showGame = {"/appearance/splitheader/showGame", false}; BoolSetting showUptime = {"/appearance/splitheader/showUptime", false}; - + FloatSetting customThemeMultiplier = {"/appearance/customThemeMultiplier", + -0.5f}; // BoolSetting useCustomWindowFrame = {"/appearance/useCustomWindowFrame", // false}; diff --git a/src/singletons/Theme.cpp b/src/singletons/Theme.cpp index 38dd6f257..67ceacb92 100644 --- a/src/singletons/Theme.cpp +++ b/src/singletons/Theme.cpp @@ -28,6 +28,9 @@ namespace detail { { return -0.8; } + else if (themeName == "Custom") { + return getSettings()->customThemeMultiplier.getValue(); + } return -0.8; } diff --git a/src/widgets/settingspages/LookPage.cpp b/src/widgets/settingspages/LookPage.cpp index 558504915..06d333612 100644 --- a/src/widgets/settingspages/LookPage.cpp +++ b/src/widgets/settingspages/LookPage.cpp @@ -21,7 +21,7 @@ #include #include -#define THEME_ITEMS "White", "Light", "Dark", "Black" +#define THEME_ITEMS "White", "Light", "Dark", "Black", "Custom" #define TAB_X "Show tab close button" #define TAB_PREF "Hide preferences button (ctrl+p to show)" @@ -79,14 +79,43 @@ void LookPage::addInterfaceTab(LayoutCreator layout) { auto *theme = this->createComboBox({THEME_ITEMS}, getApp()->themes->themeName); + QDoubleSpinBox *w = new QDoubleSpinBox; + QObject::connect(theme, &QComboBox::currentTextChanged, - [](const QString &) { + [w](const QString &themeName) { + if (themeName == "Custom") { + w->show(); + } else { + w->hide(); + } getApp()->windows->forceLayoutChannelViews(); }); auto box = layout.emplace().withoutMargin(); box.emplace("Theme: "); box.append(theme); + + { + w->setButtonSymbols(QDoubleSpinBox::NoButtons); + if (getApp()->themes->themeName.getValue() != "Custom") { + w->hide(); + } else { + w->show(); + } + w->setRange(-1.0, 1.0); + w->setSingleStep(0.05); + w->setValue(getSettings()->customThemeMultiplier.getValue()); + + QObject::connect( + w, QOverload::of(&QDoubleSpinBox::valueChanged), + [](double value) { + getSettings()->customThemeMultiplier.setValue(float(value)); + getApp()->themes->update(); + getApp()->windows->forceLayoutChannelViews(); + }); + box.append(w); + } + box->addStretch(1); }