mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Terminal: Grey out color scheme widget when there's nothing to select
By default we only include one color scheme.
This commit is contained in:
parent
2af5bb9083
commit
0486e5895d
1 changed files with 1 additions and 0 deletions
|
@ -169,6 +169,7 @@ static RefPtr<GUI::Window> create_settings_window(VT::TerminalWidget& terminal)
|
|||
color_scheme_combo.set_only_allow_values_from_model(true);
|
||||
color_scheme_combo.set_model(*GUI::ItemListModel<String>::create(color_scheme_names));
|
||||
color_scheme_combo.set_selected_index(color_scheme_names.find_first_index(terminal.color_scheme_name()).value());
|
||||
color_scheme_combo.set_enabled(color_scheme_names.size() > 1);
|
||||
color_scheme_combo.on_change = [&](auto&, const GUI::ModelIndex& index) {
|
||||
terminal.set_color_scheme(index.data().as_string());
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue