fmeditor-slint/ui/widgets/layout.slint

44 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-04-10 10:46:53 +00:00
import {Metrics, DarkPalette} from "../theme.slint";
struct BorderStyle {
border-width: length,
border-color: brush,
border-radius: length,
}
export component HorizontalBox inherits Rectangle {
// TODO: border, shadow
in property <length> j-rounding: 0px;
in property <length> j-padding: Metrics.padding-md;
in property <length> j-spacing: Metrics.spacing-md;
in property <LayoutAlignment> j-alignment: start;
background: DarkPalette.background[1];
border-radius: j-rounding;
HorizontalLayout {
alignment: j-alignment;
padding: j-padding;
spacing: j-spacing;
@children
}
}
export component VerticalBox inherits Rectangle {
// TODO: border, shadow
in property <length> j-rounding: 0px;
in property <length> j-padding: Metrics.padding-md;
in property <length> j-spacing: Metrics.spacing-md;
in property <LayoutAlignment> j-alignment: start;
background: DarkPalette.background[1];
border-radius: j-rounding;
VerticalLayout {
alignment: j-alignment;
padding: j-padding;
spacing: j-spacing;
@children
}
}