fmeditor-slint/ui/widgets/layout.slint

55 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2024-04-10 10:46:53 +00:00
import {Metrics, DarkPalette} from "../theme.slint";
export component HorizontalBox inherits Rectangle {
// TODO: border, shadow
in property <int> p-elevation: 1;
in property <length> p-rounding: Metrics.radius-md;
in property <length> p-padding: Metrics.padding-md;
in property <length> p-spacing: Metrics.spacing-md;
in property <LayoutAlignment> p-alignment: stretch;
background: DarkPalette.background[p-elevation];
border-radius: p-rounding;
2024-04-10 12:28:43 +00:00
clip: true;
2024-04-10 10:46:53 +00:00
c-layout := HorizontalLayout {
alignment: p-alignment;
padding: p-padding;
spacing: p-spacing;
2024-04-10 10:46:53 +00:00
@children
}
}
export component VerticalBox inherits Rectangle {
// TODO: border, shadow
in property <int> p-elevation: 1;
in property <length> p-rounding: Metrics.radius-md;
in property <length> p-padding: Metrics.padding-md;
in property <length> p-spacing: Metrics.spacing-md;
in property <LayoutAlignment> p-alignment: stretch;
background: DarkPalette.background[p-elevation];
border-radius: p-rounding;
2024-04-10 12:28:43 +00:00
clip: true;
2024-04-10 10:46:53 +00:00
c-layout := VerticalLayout {
alignment: p-alignment;
padding: p-padding;
spacing: p-spacing;
2024-04-10 10:46:53 +00:00
@children
}
}
2024-04-10 12:43:50 +00:00
export component Box inherits Rectangle {
in property <int> p-elevation: 1;
in property <length> p-rounding: Metrics.radius-md;
in property <length> p-padding: Metrics.padding-md;
2024-04-10 12:43:50 +00:00
background: DarkPalette.background[p-elevation];
border-radius: p-rounding;
2024-04-10 12:43:50 +00:00
clip: true;
padding: p-padding;
2024-04-10 12:43:50 +00:00
@children
}