1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

DisplaySettings: Set window modified state

This commit is contained in:
Sam Atkins 2022-05-11 17:08:32 +01:00 committed by Andreas Kling
parent af01c6be0c
commit d7190be3a3
5 changed files with 23 additions and 7 deletions

View file

@ -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;
}