From c67f6efb32869dbbdbc2df4e80bdb9636711390d Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Wed, 10 Apr 2024 13:40:35 +0100 Subject: [PATCH] Made default box alignment stretch --- ui/appwindow.slint | 2 -- ui/editor_bar.slint | 1 + ui/object_tool_panel.slint | 7 +------ ui/status_bar.slint | 1 + ui/tool_bar.slint | 1 + ui/widgets/layout.slint | 4 ++-- ui/widgets/panel.slint | 2 +- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/appwindow.slint b/ui/appwindow.slint index 92bc08b..6163a5e 100644 --- a/ui/appwindow.slint +++ b/ui/appwindow.slint @@ -14,12 +14,10 @@ export component AppWindow inherits Window { j-rounding: 0px; j-padding: Metrics.padding-sm; j-spacing: Metrics.spacing-sm; - j-alignment: stretch; background: DarkPalette.background[0]; EditorBar { } HorizontalBox { - j-alignment: stretch; background: DarkPalette.background[0]; j-padding: 0px; j-spacing: Metrics.spacing-sm; diff --git a/ui/editor_bar.slint b/ui/editor_bar.slint index 84baec3..a7a7492 100644 --- a/ui/editor_bar.slint +++ b/ui/editor_bar.slint @@ -4,6 +4,7 @@ import { HorizontalBox } from "widgets/layout.slint"; export component EditorBar inherits HorizontalBox { height: Metrics.size-xl; j-spacing: Metrics.spacing-xl; + j-alignment: start; Text { color: DarkPalette.text[4]; diff --git a/ui/object_tool_panel.slint b/ui/object_tool_panel.slint index 6bbb913..0c0c5b5 100644 --- a/ui/object_tool_panel.slint +++ b/ui/object_tool_panel.slint @@ -5,7 +5,6 @@ import { HorizontalBox, VerticalBox } from "widgets/layout.slint"; export component ObjectToolPanel inherits VerticalBox { width: 280px; - j-alignment: stretch; Text { height: Metrics.size-md; @@ -16,6 +15,7 @@ export component ObjectToolPanel inherits VerticalBox { } Panel { + j-alignment: start; title: @tr("Favourites"); j-elevation: 2; @@ -83,11 +83,9 @@ export component ObjectToolPanel inherits VerticalBox { Panel { title: @tr("Hierarchy"); j-elevation: 2; - j-alignment: stretch; vertical-stretch: 1; HorizontalBox { - j-alignment: stretch; j-elevation: 2; j-padding: 0px; j-spacing: Metrics.spacing-md; @@ -101,7 +99,6 @@ export component ObjectToolPanel inherits VerticalBox { } HorizontalBox { - j-alignment: stretch; j-padding: 0px; Text { @@ -129,8 +126,6 @@ export component ObjectToolPanel inherits VerticalBox { } VerticalBox { - j-alignment: stretch; - Text { color: DarkPalette.text[4]; font-size: Metrics.font-lg; diff --git a/ui/status_bar.slint b/ui/status_bar.slint index e5f30ac..4d8ccd3 100644 --- a/ui/status_bar.slint +++ b/ui/status_bar.slint @@ -5,6 +5,7 @@ import { HorizontalBox } from "widgets/layout.slint"; export component StatusBar inherits HorizontalBox { height: Metrics.size-lg; j-spacing: Metrics.spacing-lg; + j-alignment: start; Text { color: DarkPalette.text[4]; diff --git a/ui/tool_bar.slint b/ui/tool_bar.slint index 00076e2..a842426 100644 --- a/ui/tool_bar.slint +++ b/ui/tool_bar.slint @@ -12,6 +12,7 @@ component ToolBarItem inherits Rectangle { export component ToolBar inherits VerticalBox { width: Metrics.size-xl; + j-alignment: start; Button { checkable: true; diff --git a/ui/widgets/layout.slint b/ui/widgets/layout.slint index c953f05..6edff15 100644 --- a/ui/widgets/layout.slint +++ b/ui/widgets/layout.slint @@ -12,7 +12,7 @@ export component HorizontalBox inherits Rectangle { in property j-rounding: Metrics.radius-md; in property j-padding: Metrics.padding-md; in property j-spacing: Metrics.spacing-md; - in property j-alignment: start; + in property j-alignment: stretch; background: DarkPalette.background[j-elevation]; border-radius: j-rounding; @@ -32,7 +32,7 @@ export component VerticalBox inherits Rectangle { in property j-rounding: Metrics.radius-md; in property j-padding: Metrics.padding-md; in property j-spacing: Metrics.spacing-md; - in property j-alignment: start; + in property j-alignment: stretch; background: DarkPalette.background[j-elevation]; border-radius: j-rounding; diff --git a/ui/widgets/panel.slint b/ui/widgets/panel.slint index 0358e30..ae14f37 100644 --- a/ui/widgets/panel.slint +++ b/ui/widgets/panel.slint @@ -1,5 +1,5 @@ import { Metrics, DarkPalette } from "../theme.slint"; -import { HorizontalBox, VerticalBox } from "layout.slint"; +import { VerticalBox } from "layout.slint"; export component Panel inherits VerticalBox { in property title: "Title";