Make separators inherit Path directly and allow elevation setting

This commit is contained in:
Jarrod Doyle 2024-04-14 12:33:11 +01:00
parent 35966bc8e3
commit 4ccbd7b28b
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 12 additions and 15 deletions

View File

@ -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");

View File

@ -1,21 +1,19 @@
import {DarkPalette} from "../theme.slint";
export component VerticalSeparator {
export component VerticalSeparator inherits Path {
in property <int> p-elevation: 0;
width: 1px;
Path {
width: 1px;
stroke: DarkPalette.background[0];
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 <int> p-elevation: 0;
height: 1px;
Path {
height: 1px;
stroke: DarkPalette.background[0];
stroke: DarkPalette.background[root.p-elevation];
stroke-width: 1px;
commands: "M 0 0 L 1 0 Z";
}
}