From 4ccbd7b28b306561d93431ac2b03b00de85be2cb Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 14 Apr 2024 12:33:11 +0100 Subject: [PATCH] Make separators inherit Path directly and allow elevation setting --- ui/appwindow.slint | 1 - ui/widgets/separator.slint | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ui/appwindow.slint b/ui/appwindow.slint index 77c2637..a1ab547 100644 --- a/ui/appwindow.slint +++ b/ui/appwindow.slint @@ -4,7 +4,6 @@ import { StatusBar } from "status_bar.slint"; import { ToolBar } from "tool_bar.slint"; import { ObjectToolPanel } from "object_tool_panel.slint"; import { VerticalBox, HorizontalBox } from "widgets/layout.slint"; -import { VerticalSeparator } from "widgets/separator.slint"; export component AppWindow inherits Window { title: @tr("FM Editor"); diff --git a/ui/widgets/separator.slint b/ui/widgets/separator.slint index 9f37969..f09a005 100644 --- a/ui/widgets/separator.slint +++ b/ui/widgets/separator.slint @@ -1,21 +1,19 @@ import {DarkPalette} from "../theme.slint"; -export component VerticalSeparator { +export component VerticalSeparator inherits Path { + in property p-elevation: 0; + width: 1px; - Path { - width: 1px; - stroke: DarkPalette.background[0]; - stroke-width: 1px; - commands: "M 0 0 L 0 1 Z"; - } + stroke: DarkPalette.background[root.p-elevation]; + stroke-width: 1px; + commands: "M 0 0 L 0 1 Z"; } -export component HorizontalSeparator { +export component HorizontalSeparator inherits Path { + in property p-elevation: 0; + height: 1px; - Path { - height: 1px; - stroke: DarkPalette.background[0]; - stroke-width: 1px; - commands: "M 0 0 L 1 0 Z"; - } + stroke: DarkPalette.background[root.p-elevation]; + stroke-width: 1px; + commands: "M 0 0 L 1 0 Z"; }