2024-04-10 10:46:53 +00:00
|
|
|
import {Metrics, DarkPalette} from "../theme.slint";
|
|
|
|
|
|
|
|
export component HorizontalBox inherits Rectangle {
|
|
|
|
// TODO: border, shadow
|
2024-04-10 15:50:54 +00:00
|
|
|
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
|
|
|
|
2024-04-10 15:50:54 +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
|
2024-04-10 15:50:54 +00:00
|
|
|
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
|
|
|
|
2024-04-10 15:50:54 +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 {
|
2024-04-10 15:50:54 +00:00
|
|
|
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
|
|
|
|
2024-04-10 15:50:54 +00:00
|
|
|
background: DarkPalette.background[p-elevation];
|
|
|
|
border-radius: p-rounding;
|
2024-04-10 12:43:50 +00:00
|
|
|
clip: true;
|
2024-04-10 15:50:54 +00:00
|
|
|
padding: p-padding;
|
2024-04-10 12:43:50 +00:00
|
|
|
|
|
|
|
@children
|
|
|
|
}
|