summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-05-11 17:08:32 +0100
committerAndreas Kling <kling@serenityos.org>2022-05-12 13:10:49 +0200
commitd7190be3a35eacda44042b8405fa91ffe3d27b6f (patch)
treefa2663ec3c99779bd17023874c1a645806f9ad8a /Userland/Applications
parentaf01c6be0ca11f9bda7b0f38e63122d4e35f604f (diff)
downloadserenity-d7190be3a35eacda44042b8405fa91ffe3d27b6f.zip
DisplaySettings: Set window modified state
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp8
-rw-r--r--Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp10
-rw-r--r--Userland/Applications/DisplaySettings/FontSettingsWidget.cpp2
-rw-r--r--Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp7
-rw-r--r--Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp3
5 files changed, 23 insertions, 7 deletions
diff --git a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp
index 75671e5d1e..1a02a50ef2 100644
--- a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp
@@ -61,6 +61,7 @@ void BackgroundSettingsWidget::create_frame()
}
m_monitor_widget->set_wallpaper(path);
+ set_modified(true);
};
m_context_menu = GUI::Menu::construct();
@@ -93,6 +94,7 @@ void BackgroundSettingsWidget::create_frame()
m_wallpaper_view->selection().clear();
m_monitor_widget->set_wallpaper(path.value());
m_background_settings_changed = true;
+ set_modified(true);
};
m_mode_combo = *find_descendant_of_type_named<GUI::ComboBox>("mode_combo");
@@ -103,6 +105,7 @@ void BackgroundSettingsWidget::create_frame()
m_monitor_widget->set_wallpaper_mode(m_modes.at(index.row()));
m_background_settings_changed = !first_mode_change;
first_mode_change = false;
+ set_modified(true);
};
m_color_input = *find_descendant_of_type_named<GUI::ColorInput>("color_input");
@@ -113,6 +116,7 @@ void BackgroundSettingsWidget::create_frame()
m_monitor_widget->set_background_color(m_color_input->color());
m_background_settings_changed = !first_color_change;
first_color_change = false;
+ set_modified(true);
};
}
@@ -133,7 +137,7 @@ void BackgroundSettingsWidget::load_current_settings()
mode = "center";
}
m_monitor_widget->set_wallpaper_mode(mode);
- m_mode_combo->set_selected_index(m_modes.find_first_index(mode).value_or(0));
+ m_mode_combo->set_selected_index(m_modes.find_first_index(mode).value_or(0), GUI::AllowCallback::No);
auto palette_desktop_color = palette().desktop_background();
auto background_color = ws_config->read_entry("Background", "Color", "");
@@ -144,7 +148,7 @@ void BackgroundSettingsWidget::load_current_settings()
palette_desktop_color = opt_color.value();
}
- m_color_input->set_color(palette_desktop_color);
+ m_color_input->set_color(palette_desktop_color, GUI::AllowCallback::No);
m_monitor_widget->set_background_color(palette_desktop_color);
m_background_settings_changed = false;
}
diff --git a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp
index d0d5b8df70..ba38f72e4a 100644
--- a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp
@@ -26,14 +26,20 @@ void DesktopSettingsWidget::create_frame()
load_from_gml(desktop_settings_gml);
m_workspace_rows_spinbox = *find_descendant_of_type_named<GUI::SpinBox>("workspace_rows_spinbox");
+ m_workspace_rows_spinbox->on_change = [&](auto) {
+ set_modified(true);
+ };
m_workspace_columns_spinbox = *find_descendant_of_type_named<GUI::SpinBox>("workspace_columns_spinbox");
+ m_workspace_columns_spinbox->on_change = [&](auto) {
+ set_modified(true);
+ };
}
void DesktopSettingsWidget::load_current_settings()
{
auto& desktop = GUI::Desktop::the();
- m_workspace_rows_spinbox->set_value(desktop.workspace_rows());
- m_workspace_columns_spinbox->set_value(desktop.workspace_columns());
+ m_workspace_rows_spinbox->set_value(desktop.workspace_rows(), GUI::AllowCallback::No);
+ m_workspace_columns_spinbox->set_value(desktop.workspace_columns(), GUI::AllowCallback::No);
}
void DesktopSettingsWidget::apply_settings()
diff --git a/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp b/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp
index 7ab043a556..00016ecb5c 100644
--- a/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp
@@ -30,6 +30,7 @@ FontSettingsWidget::FontSettingsWidget()
auto font_picker = GUI::FontPicker::construct(window(), &m_default_font_label->font(), false);
if (font_picker->exec() == GUI::Dialog::ExecOK) {
update_label_with_font(*m_default_font_label, *font_picker->font());
+ set_modified(true);
}
};
@@ -42,6 +43,7 @@ FontSettingsWidget::FontSettingsWidget()
auto font_picker = GUI::FontPicker::construct(window(), &m_fixed_width_font_label->font(), true);
if (font_picker->exec() == GUI::Dialog::ExecOK) {
update_label_with_font(*m_fixed_width_font_label, *font_picker->font());
+ set_modified(true);
}
};
}
diff --git a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp
index 0ab0afe31e..ac0d5950f6 100644
--- a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp
@@ -92,6 +92,7 @@ void MonitorSettingsWidget::create_frame()
// Try to auto re-arrange things if there are overlaps or disconnected screens
m_screen_layout.normalize();
selected_screen_index_or_resolution_changed();
+ set_modified(true);
};
m_display_scale_radio_1x = *find_descendant_of_type_named<GUI::RadioButton>("scale_1x");
@@ -103,6 +104,7 @@ void MonitorSettingsWidget::create_frame()
m_screen_layout.normalize();
m_monitor_widget->set_desktop_scale_factor(1);
m_monitor_widget->update();
+ set_modified(true);
}
};
m_display_scale_radio_2x = *find_descendant_of_type_named<GUI::RadioButton>("scale_2x");
@@ -114,6 +116,7 @@ void MonitorSettingsWidget::create_frame()
m_screen_layout.normalize();
m_monitor_widget->set_desktop_scale_factor(2);
m_monitor_widget->update();
+ set_modified(true);
}
};
@@ -209,12 +212,12 @@ void MonitorSettingsWidget::selected_screen_index_or_resolution_changed()
dbgln("unexpected ScaleFactor {}, setting to 1", screen.scale_factor);
screen.scale_factor = 1;
}
- (screen.scale_factor == 1 ? m_display_scale_radio_1x : m_display_scale_radio_2x)->set_checked(true);
+ (screen.scale_factor == 1 ? m_display_scale_radio_1x : m_display_scale_radio_2x)->set_checked(true, GUI::AllowCallback::No);
m_monitor_widget->set_desktop_scale_factor(screen.scale_factor);
// Select the current selected resolution as it may differ
m_monitor_widget->set_desktop_resolution(current_resolution);
- m_resolution_combo->set_selected_index(index);
+ m_resolution_combo->set_selected_index(index, GUI::AllowCallback::No);
m_monitor_widget->update();
}
diff --git a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp
index bdfd64ccac..f218da20d7 100644
--- a/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp
+++ b/Userland/Applications/DisplaySettings/ThemesSettingsWidget.cpp
@@ -44,8 +44,9 @@ ThemesSettingsWidget::ThemesSettingsWidget(bool& background_settings_changed)
m_themes_combo->on_change = [this](auto&, const GUI::ModelIndex& index) {
m_selected_theme = &m_themes.at(index.row());
m_theme_preview->set_theme(m_selected_theme->path);
+ set_modified(true);
};
- m_themes_combo->set_selected_index(current_theme_index);
+ m_themes_combo->set_selected_index(current_theme_index, GUI::AllowCallback::No);
}
void ThemesSettingsWidget::apply_settings()