diff options
author | FrHun <28605587+frhun@users.noreply.github.com> | 2022-02-22 20:01:20 +0100 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-06-28 17:52:42 +0100 |
commit | a6ec2b9d0aafc40cb929068f271dd68adee3d77e (patch) | |
tree | 878d051fd4ad5177a00257f60c78186473e07fcf | |
parent | 39789604812129498920457eadc1d4296c8ac1ba (diff) | |
download | serenity-a6ec2b9d0aafc40cb929068f271dd68adee3d77e.zip |
LibGUI+Applications: Use the new layout system in the settings screens
8 files changed, 35 insertions, 38 deletions
diff --git a/Userland/Applications/DisplaySettings/BackgroundSettings.gml b/Userland/Applications/DisplaySettings/BackgroundSettings.gml index df1fbabd3b..168ad17014 100644 --- a/Userland/Applications/DisplaySettings/BackgroundSettings.gml +++ b/Userland/Applications/DisplaySettings/BackgroundSettings.gml @@ -28,22 +28,20 @@ @GUI::IconView { name: "wallpaper_view" + preferred_width: "opportunistic_grow" } @GUI::Widget { - shrink_to_fit: true + preferred_width: "fit" layout: @GUI::VerticalBoxLayout {} @GUI::Button { name: "wallpaper_open_button" tooltip: "Select wallpaper from file system" text: "Browse..." - shrink_to_fit: true } - @GUI::Widget { - fixed_height: 12 - } + @GUI::Layout::Spacer {} @GUI::Label { text: "Mode:" @@ -55,9 +53,7 @@ name: "mode_combo" } - @GUI::Widget { - fixed_height: 12 - } + @GUI::Layout::Spacer {} @GUI::Label { text: "Color:" diff --git a/Userland/Applications/DisplaySettings/FontSettings.gml b/Userland/Applications/DisplaySettings/FontSettings.gml index 39144af16c..9470bb6a9e 100644 --- a/Userland/Applications/DisplaySettings/FontSettings.gml +++ b/Userland/Applications/DisplaySettings/FontSettings.gml @@ -6,7 +6,7 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout { spacing: 6 } @@ -17,14 +17,13 @@ text_alignment: "CenterLeft" } - @GUI::Frame { + @GUI::Label { background_role: "Base" + shadow: "Sunken" + shape: "Container" + thickness: 2 fill_with_background_color: true - layout: @GUI::VerticalBoxLayout {} - - @GUI::Label { - name: "default_font_label" - } + name: "default_font_label" } @GUI::Button { @@ -35,7 +34,7 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout { spacing: 6 } @@ -46,14 +45,13 @@ text_alignment: "CenterLeft" } - @GUI::Frame { + @GUI::Label { background_role: "Base" + shadow: "Sunken" + shape: "Container" + thickness: 2 fill_with_background_color: true - layout: @GUI::VerticalBoxLayout {} - - @GUI::Label { - name: "fixed_width_font_label" - } + name: "fixed_width_font_label" } @GUI::Button { @@ -63,5 +61,5 @@ } } - @GUI::Widget {} + @GUI::Layout::Spacer {} } diff --git a/Userland/Applications/DisplaySettings/MonitorSettings.gml b/Userland/Applications/DisplaySettings/MonitorSettings.gml index cd39596a69..8acc169c79 100644 --- a/Userland/Applications/DisplaySettings/MonitorSettings.gml +++ b/Userland/Applications/DisplaySettings/MonitorSettings.gml @@ -15,7 +15,7 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout { margins: [8, 8, 6, 16] } @@ -38,7 +38,7 @@ title: "Screen settings" @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout {} @GUI::Label { @@ -64,7 +64,7 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout {} @GUI::Label { @@ -84,6 +84,8 @@ text: "2x" fixed_width: 50 } + + @GUI::Layout::Spacer {} } } } diff --git a/Userland/Applications/DisplaySettings/ThemesSettings.gml b/Userland/Applications/DisplaySettings/ThemesSettings.gml index 28b2aaa16c..56ed183fc4 100644 --- a/Userland/Applications/DisplaySettings/ThemesSettings.gml +++ b/Userland/Applications/DisplaySettings/ThemesSettings.gml @@ -23,13 +23,13 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout {} @GUI::Label { text: "Theme:" text_alignment: "CenterLeft" - fixed_width: 95 + preferred_width: 95 } @GUI::ComboBox { diff --git a/Userland/Applications/MouseSettings/Theme.gml b/Userland/Applications/MouseSettings/Theme.gml index fe144e01cc..fd26d16cf0 100644 --- a/Userland/Applications/MouseSettings/Theme.gml +++ b/Userland/Applications/MouseSettings/Theme.gml @@ -12,7 +12,7 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::HorizontalBoxLayout { spacing: 8 } diff --git a/Userland/Applications/TerminalSettings/TerminalSettingsMain.gml b/Userland/Applications/TerminalSettings/TerminalSettingsMain.gml index e6600baa38..c0a49e4977 100644 --- a/Userland/Applications/TerminalSettings/TerminalSettingsMain.gml +++ b/Userland/Applications/TerminalSettings/TerminalSettingsMain.gml @@ -7,7 +7,7 @@ @GUI::GroupBox { title: "Bell Mode" - shrink_to_fit: false + preferred_height: "fit" fixed_height: 160 layout: @GUI::VerticalBoxLayout { margins: [16, 8, 8] @@ -20,7 +20,7 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::VerticalBoxLayout { spacing: 4 } @@ -44,7 +44,7 @@ @GUI::GroupBox { title: "Scrollback Size (Lines)" - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::VerticalBoxLayout { margins: [16, 8, 8] } @@ -64,7 +64,7 @@ @GUI::GroupBox { title: "Exit Behaviour" - shrink_to_fit: true + preferred_height: "fit" layout: @GUI::VerticalBoxLayout { margins: [16, 8, 8] } diff --git a/Userland/Applications/TerminalSettings/TerminalSettingsView.gml b/Userland/Applications/TerminalSettings/TerminalSettingsView.gml index 7a56457bdf..7c4fbf8444 100644 --- a/Userland/Applications/TerminalSettings/TerminalSettingsView.gml +++ b/Userland/Applications/TerminalSettings/TerminalSettingsView.gml @@ -7,7 +7,7 @@ @GUI::GroupBox { title: "Background Opacity" - fixed_height: 70 + preferred_height: "fit" layout: @GUI::VerticalBoxLayout { margins: [16, 8, 8] spacing: 16 @@ -23,7 +23,7 @@ @GUI::GroupBox { title: "Terminal Font" - fixed_height: 100 + preferred_height: "fit" layout: @GUI::VerticalBoxLayout { margins: [16, 8, 8] spacing: 16 @@ -35,13 +35,14 @@ } @GUI::Widget { - shrink_to_fit: true + preferred_height: "fit" name: "terminal_font_selection" layout: @GUI::HorizontalBoxLayout { spacing: 6 } @GUI::Frame { + preferred_height: "fit" background_role: "Base" fill_with_background_color: true layout: @GUI::VerticalBoxLayout {} @@ -89,7 +90,7 @@ @GUI::GroupBox { title: "Color Scheme" - fixed_height: 70 + preferred_height: "fit" layout: @GUI::VerticalBoxLayout { margins: [16, 8, 8] spacing: 16 diff --git a/Userland/Libraries/LibGUI/SettingsWindow.cpp b/Userland/Libraries/LibGUI/SettingsWindow.cpp index cbd3a2d0ef..efb4599bd6 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.cpp +++ b/Userland/Libraries/LibGUI/SettingsWindow.cpp @@ -41,7 +41,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(String title, Show window->m_tab_widget = TRY(main_widget->try_add<GUI::TabWidget>()); auto button_container = TRY(main_widget->try_add<GUI::Widget>()); - button_container->set_shrink_to_fit(true); + button_container->set_preferred_size({ SpecialDimension::Grow, SpecialDimension::Fit }); (void)TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>()); button_container->layout()->set_spacing(6); |