mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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
Notes:
sideshowbarker
2024-07-18 10:29:54 +09:00
Author: https://github.com/luk1337 Commit: https://github.com/SerenityOS/serenity/commit/0486e5895d3 Pull-request: https://github.com/SerenityOS/serenity/pull/8423 Reviewed-by: https://github.com/awesomekling
@ -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…
Reference in New Issue
Block a user