diff --git a/src/settings/appearancesettingspage.cpp b/src/settings/appearancesettingspage.cpp index 2e801ad28..60738dd00 100644 --- a/src/settings/appearancesettingspage.cpp +++ b/src/settings/appearancesettingspage.cpp @@ -42,6 +42,7 @@ #include #include "appearancesettingspage.h" +#include "core/utilities.h" #include "core/appearance.h" #include "core/iconloader.h" #include "core/stylehelper.h" @@ -176,7 +177,7 @@ void AppearanceSettingsPage::Load() { ui_->tabbar_system_color->setChecked(tabbar_system_color); ui_->tabbar_custom_color->setChecked(!tabbar_system_color); - current_tabbar_bg_color_ = s.value(kTabBarColor, StyleHelper::highlightColor()).value(); + current_tabbar_bg_color_ = s.value(kTabBarColor, DefaultTabbarBgColor()).value(); UpdateColorSelectorColor(ui_->select_tabbar_color, current_tabbar_bg_color_); TabBarSystemColor(ui_->tabbar_system_color->isChecked()); @@ -415,7 +416,7 @@ void AppearanceSettingsPage::OpacityLevelChanged(int percent) { void AppearanceSettingsPage::TabBarSystemColor(bool checked) { if (checked) { - current_tabbar_bg_color_ = StyleHelper::highlightColor(); + current_tabbar_bg_color_ = DefaultTabbarBgColor(); UpdateColorSelectorColor(ui_->select_tabbar_color, current_tabbar_bg_color_); } ui_->layout_tabbar_color->setEnabled(!checked); @@ -463,3 +464,13 @@ void AppearanceSettingsPage::PlaylistPlayingSongSelectColor() { set_changed(); } + +QColor AppearanceSettingsPage::DefaultTabbarBgColor() { + + QColor color = StyleHelper::highlightColor(); + if (Utilities::IsColorDark(color)) { + color = color.lighter(130); + } + return color; + +} diff --git a/src/settings/appearancesettingspage.h b/src/settings/appearancesettingspage.h index 0d3d1099d..597cec095 100644 --- a/src/settings/appearancesettingspage.h +++ b/src/settings/appearancesettingspage.h @@ -99,6 +99,8 @@ class AppearanceSettingsPage : public SettingsPage { void Save() override; void Cancel() override; + static QColor DefaultTabbarBgColor(); + private slots: void SelectForegroundColor(); void SelectBackgroundColor(); diff --git a/src/widgets/fancytabwidget.cpp b/src/widgets/fancytabwidget.cpp index 04e71a317..5f17f203e 100644 --- a/src/widgets/fancytabwidget.cpp +++ b/src/widgets/fancytabwidget.cpp @@ -522,7 +522,10 @@ void FancyTabWidget::ReloadSettings() { s.beginGroup(AppearanceSettingsPage::kSettingsGroup); bg_color_system_ = s.value(AppearanceSettingsPage::kTabBarSystemColor, false).toBool(); bg_gradient_ = s.value(AppearanceSettingsPage::kTabBarGradient, true).toBool(); - bg_color_ = s.value(AppearanceSettingsPage::kTabBarColor, StyleHelper::highlightColor()).value(); + bg_color_ = AppearanceSettingsPage::DefaultTabbarBgColor(); + if (!bg_color_system_) { + bg_color_ = s.value(AppearanceSettingsPage::kTabBarColor, bg_color_).value(); + } iconsize_smallsidebar_ = s.value(AppearanceSettingsPage::kIconSizeTabbarSmallMode, FancyTabWidget::IconSize_SmallSidebar).toInt(); iconsize_largesidebar_ = s.value(AppearanceSettingsPage::kIconSizeTabbarLargeMode, FancyTabWidget::IconSize_LargeSidebar).toInt(); s.endGroup();