1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 10:17:31 +00:00

MouseSettings: Only allow valid cursor themes

To align the cursor theme tab to how DisplaySettings themes tab works,
this change forces the theme combo box to not allow free-text. Currently
on a click it puts the text cursor in the box to allow typing anything
rather than acting as a dropdown when clicking anywhere on the field.

Fixes #24306
This commit is contained in:
Hugh Davenport 2024-05-13 14:16:09 +12:00 committed by Sam Atkins
parent 855f6417df
commit 9772590e9a

View File

@ -135,6 +135,7 @@ ErrorOr<void> ThemeWidget::initialize()
m_mouse_cursor_model->change_theme(theme_name);
m_theme_name_box = find_descendant_of_type_named<GUI::ComboBox>("theme_name_box");
m_theme_name_box->set_only_allow_values_from_model(true);
m_theme_name_box->on_change = [this](ByteString const& value, GUI::ModelIndex const&) {
m_mouse_cursor_model->change_theme(value);
set_modified(true);