瀏覽代碼

Applications+Games+LibGUI: Fix layout problems

FrHun 3 年之前
父節點
當前提交
f59c167bb0

+ 1 - 1
Userland/Applications/CharacterMap/CharacterMapWindow.gml

@@ -40,7 +40,7 @@
             }
 
             @GUI::Widget {
-                shrink_to_fit: true
+                preferred_height: "fit"
                 layout: @GUI::HorizontalBoxLayout {
                     spacing: 4
                     margins: [0, 2, 0, 2]

+ 8 - 8
Userland/Applications/ClockSettings/ClockSettingsWidget.gml

@@ -19,7 +19,7 @@
         }
 
         @GUI::Widget {
-            shrink_to_fit: true
+            preferred_height: "fit"
             layout: @GUI::VerticalBoxLayout {
                 spacing: 4
             }
@@ -59,15 +59,15 @@
             @GUI::Label {
                 text: "Preview:"
                 text_alignment: "CenterLeft"
+                preferred_width: 120
             }
 
-            @GUI::Frame {
-                layout: @GUI::VerticalBoxLayout {}
-
-                @GUI::Label {
-                    name: "clock_preview"
-                    text: "12:34:56"
-                }
+            @GUI::Label {
+                shape: "Container"
+                thickness: 2
+                shadow: "Sunken"
+                name: "clock_preview"
+                text: "12:34:56"
             }
         }
     }

+ 1 - 1
Userland/Applications/PixelPaint/EditGuideDialog.cpp

@@ -20,7 +20,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, String const& offse
 {
     set_title("Create new Guide");
     set_icon(parent_window->icon());
-    resize(200, 120);
+    resize(200, 130);
     set_resizable(false);
 
     auto& main_widget = set_main_widget<GUI::Widget>();

+ 5 - 7
Userland/Applications/PixelPaint/EditGuideDialog.gml

@@ -9,7 +9,7 @@
 
         @GUI::GroupBox {
             title: "Orientation"
-            shrink_to_fit: true
+            preferred_height: "fit"
             layout: @GUI::HorizontalBoxLayout {
                 margins: [10, 8, 8]
             }
@@ -30,7 +30,7 @@
         layout: @GUI::HorizontalBoxLayout {
             margins: [4]
         }
-        shrink_to_fit: true
+        preferred_height: "fit"
 
         @GUI::Label {
             text: "Offset"
@@ -48,18 +48,16 @@
             margins: [4]
         }
 
-        @GUI::Widget {}
+        @GUI::Layout::Spacer {}
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "ok_button"
             text: "OK"
-            max_width: 75
         }
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "cancel_button"
             text: "Cancel"
-            max_width: 75
         }
     }
 }

+ 2 - 4
Userland/Applications/PixelPaint/FilterGallery.gml

@@ -45,16 +45,14 @@
 
         @GUI::Widget {}
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "apply_button"
             text: "Apply"
-            max_width: 75
         }
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "cancel_button"
             text: "Cancel"
-            max_width: 75
         }
     }
 }

+ 1 - 0
Userland/Applications/PixelPaint/FilterParams.h

@@ -65,6 +65,7 @@ private:
             for (size_t column = 0; column < columns; ++column) {
                 if (index < columns * rows) {
                     auto& textbox = horizontal_container.template add<GUI::TextBox>();
+                    textbox.set_min_width(22);
                     textbox.on_change = [&, row = row, column = column] {
                         auto& element = m_matrix.elements()[row][column];
                         char* endptr = nullptr;

+ 5 - 7
Userland/Applications/PixelPaint/ResizeImageDialog.gml

@@ -8,7 +8,7 @@
 
     @GUI::GroupBox {
         title: "Size (px)"
-        shrink_to_fit: true
+        preferred_height: "fit"
         layout: @GUI::VerticalBoxLayout {
             margins: [4]
         }
@@ -69,7 +69,7 @@
 
     @GUI::GroupBox {
         title: "Scaling Mode"
-        shrink_to_fit: true
+        preferred_height: "fit"
         layout: @GUI::VerticalBoxLayout {
             margins: [4]
         }
@@ -97,18 +97,16 @@
     @GUI::Widget {
         layout: @GUI::HorizontalBoxLayout {}
 
-        @GUI::Widget {}
+        @GUI::Layout::Spacer {}
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "ok_button"
             text: "OK"
-            max_width: 75
         }
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "cancel_button"
             text: "Cancel"
-            max_width: 75
         }
     }
 }

+ 6 - 8
Userland/Applications/TerminalSettings/TerminalSettingsView.gml

@@ -41,15 +41,13 @@
                 spacing: 6
             }
 
-            @GUI::Frame {
-                preferred_height: "fit"
+            @GUI::Label {
                 background_role: "Base"
+                shape: "Container"
+                shadow: "Sunken"
+                thickness: 2
                 fill_with_background_color: true
-                layout: @GUI::VerticalBoxLayout {}
-
-                @GUI::Label {
-                    name: "terminal_font_label"
-                }
+                name: "terminal_font_label"
             }
 
             @GUI::Button {
@@ -62,7 +60,7 @@
 
     @GUI::GroupBox {
         title: "Cursor settings"
-        shrink_to_fit: true
+        preferred_height: "fit"
         layout: @GUI::VerticalBoxLayout {
             margins: [16, 8, 8]
         }

+ 3 - 5
Userland/Games/Minesweeper/MinesweeperCustomGameWindow.gml

@@ -56,18 +56,16 @@
         max_height: 24
         layout: @GUI::HorizontalBoxLayout {}
 
-        @GUI::Widget {}
+        @GUI::Layout::Spacer {}
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "ok_button"
             text: "OK"
-            max_width: 75
         }
 
-        @GUI::Button {
+        @GUI::DialogButton {
             name: "cancel_button"
             text: "Cancel"
-            max_width: 75
         }
     }
 }

+ 2 - 0
Userland/Libraries/LibGUI/PasswordInputDialog.gml

@@ -14,6 +14,8 @@
             fixed_height: 32
             fixed_width: 32
         }
+
+        @GUI::Layout::Spacer {}
     }
 
     @GUI::Widget {