summaryrefslogtreecommitdiff
path: root/Userland/Applications/DisplaySettings
diff options
context:
space:
mode:
authorBen Maxwell <macdue@dueutil.tech>2022-04-03 09:22:59 +0100
committerAndreas Kling <kling@serenityos.org>2022-04-03 12:58:46 +0200
commite6ad55ab5328dc2bb5538c2ed7469b2a973f12ee (patch)
tree39e6195a8d3ee80dde5049c29f13299ffb853ca7 /Userland/Applications/DisplaySettings
parentd8ec9a550191941db7381bdc3975542b07575c9c (diff)
downloadserenity-e6ad55ab5328dc2bb5538c2ed7469b2a973f12ee.zip
DisplaySettings: Stop theme tab from overriding background color
Fixes #13448
Diffstat (limited to 'Userland/Applications/DisplaySettings')
-rw-r--r--Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp
index 5d86a07cac..955c079612 100644
--- a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp
@@ -14,14 +14,18 @@
namespace DisplaySettings {
+static inline String current_system_theme()
+{
+ return GUI::ConnectionToWindowServer::the().get_system_theme();
+}
+
ThemesSettingsWidget::ThemesSettingsWidget()
{
load_from_gml(themes_settings_gml);
m_themes = Gfx::list_installed_system_themes();
- auto current_theme_name = GUI::ConnectionToWindowServer::the().get_system_theme();
-
size_t current_theme_index;
+ auto current_theme_name = current_system_theme();
m_theme_names.ensure_capacity(m_themes.size());
for (auto& theme_meta : m_themes) {
m_theme_names.append(theme_meta.name);
@@ -45,7 +49,7 @@ ThemesSettingsWidget::ThemesSettingsWidget()
void ThemesSettingsWidget::apply_settings()
{
- if (m_selected_theme)
+ if (m_selected_theme && m_selected_theme->name != current_system_theme())
VERIFY(GUI::ConnectionToWindowServer::the().set_system_theme(m_selected_theme->path, m_selected_theme->name));
}