mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibGUI: Give some widgets a reasonable default fixed height
Instead of hard-coding 22 in random places, just make the following widgets have a fixed height of 22 by default: Button, CheckBox, ColorInput, ComboBox, RadioButton, SpinBox, TextBox. In the future we can make this relative to the current font size, but for now at least this centralizes the setting a bit better.
This commit is contained in:
parent
0f3b0b65ae
commit
1cca2405fc
17 changed files with 11 additions and 16 deletions
|
@ -116,7 +116,6 @@ void DisplaySettingsWidget::create_frame()
|
|||
wallpaper_label.set_text("Wallpaper:");
|
||||
|
||||
m_wallpaper_combo = wallpaper_selection_container.add<GUI::ComboBox>();
|
||||
m_wallpaper_combo->set_fixed_height(22);
|
||||
m_wallpaper_combo->set_only_allow_values_from_model(true);
|
||||
m_wallpaper_combo->set_model(*GUI::ItemListModel<AK::String>::create(m_wallpapers));
|
||||
m_wallpaper_combo->on_change = [this](auto& text, const GUI::ModelIndex& index) {
|
||||
|
@ -170,7 +169,6 @@ void DisplaySettingsWidget::create_frame()
|
|||
mode_label.set_text("Mode:");
|
||||
|
||||
m_mode_combo = mode_selection_container.add<GUI::ComboBox>();
|
||||
m_mode_combo->set_fixed_height(22);
|
||||
m_mode_combo->set_only_allow_values_from_model(true);
|
||||
m_mode_combo->set_model(*GUI::ItemListModel<AK::String>::create(m_modes));
|
||||
m_mode_combo->on_change = [this](auto&, const GUI::ModelIndex& index) {
|
||||
|
@ -190,7 +188,6 @@ void DisplaySettingsWidget::create_frame()
|
|||
m_resolution_label.set_text("Resolution:");
|
||||
|
||||
m_resolution_combo = resolution_selection_container.add<GUI::ComboBox>();
|
||||
m_resolution_combo->set_fixed_height(22);
|
||||
m_resolution_combo->set_only_allow_values_from_model(true);
|
||||
m_resolution_combo->set_model(*GUI::ItemListModel<Gfx::IntSize>::create(m_resolutions));
|
||||
m_resolution_combo->on_change = [this](auto&, const GUI::ModelIndex& index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue