fmeditor-slint/ui/widgets/layout.slint

61 lines
1.6 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
2024-04-10 12:28:43 +00:00
in property <int> j-elevation: 1;
2024-04-10 12:31:28 +00:00
in property <length> j-rounding: Metrics.radius-md;
2024-04-10 10:46:53 +00:00
in property <length> j-padding: Metrics.padding-md;
in property <length> j-spacing: Metrics.spacing-md;
2024-04-10 12:40:35 +00:00
in property <LayoutAlignment> j-alignment: stretch;
2024-04-10 10:46:53 +00:00
2024-04-10 12:28:43 +00:00
background: DarkPalette.background[j-elevation];
2024-04-10 10:46:53 +00:00
border-radius: j-rounding;
2024-04-10 12:28:43 +00:00
clip: true;
2024-04-10 10:46:53 +00:00
HorizontalLayout {
alignment: j-alignment;
padding: j-padding;
spacing: j-spacing;
@children
}
}
export component VerticalBox inherits Rectangle {
// TODO: border, shadow
2024-04-10 12:28:43 +00:00
in property <int> j-elevation: 1;
2024-04-10 12:31:28 +00:00
in property <length> j-rounding: Metrics.radius-md;
2024-04-10 10:46:53 +00:00
in property <length> j-padding: Metrics.padding-md;
in property <length> j-spacing: Metrics.spacing-md;
2024-04-10 12:40:35 +00:00
in property <LayoutAlignment> j-alignment: stretch;
2024-04-10 10:46:53 +00:00
2024-04-10 12:28:43 +00:00
background: DarkPalette.background[j-elevation];
2024-04-10 10:46:53 +00:00
border-radius: j-rounding;
2024-04-10 12:28:43 +00:00
clip: true;
2024-04-10 10:46:53 +00:00
VerticalLayout {
alignment: j-alignment;
padding: j-padding;
spacing: j-spacing;
@children
}
}
2024-04-10 12:43:50 +00:00
export component Box inherits Rectangle {
in property <int> j-elevation: 1;
in property <length> j-rounding: Metrics.radius-md;
in property <length> j-padding: Metrics.padding-md;
background: DarkPalette.background[j-elevation];
border-radius: j-rounding;
clip: true;
padding: j-padding;
@children
}