2024-04-10 10:34:47 +00:00
|
|
|
import { Metrics } from "../theme.slint";
|
2024-04-09 21:12:54 +00:00
|
|
|
|
|
|
|
export component Panel inherits Rectangle {
|
|
|
|
in property <string> title: "Title";
|
|
|
|
in property <TextHorizontalAlignment> title-alignment: left;
|
2024-04-10 10:34:47 +00:00
|
|
|
in property <length> content-padding: Metrics.padding-md;
|
|
|
|
in property <length> content-spacing: Metrics.spacing-md;
|
2024-04-09 21:12:54 +00:00
|
|
|
|
|
|
|
border-color: black;
|
|
|
|
border-width: 1px;
|
2024-04-10 10:34:47 +00:00
|
|
|
border-radius: Metrics.radius-md;
|
2024-04-09 21:12:54 +00:00
|
|
|
clip: true;
|
|
|
|
|
|
|
|
VerticalLayout {
|
|
|
|
Rectangle {
|
2024-04-10 10:34:47 +00:00
|
|
|
height: Metrics.size-md;
|
2024-04-09 21:12:54 +00:00
|
|
|
border-color: black;
|
|
|
|
border-width: 1px;
|
|
|
|
HorizontalLayout {
|
2024-04-10 10:34:47 +00:00
|
|
|
padding-left: Metrics.padding-md;
|
|
|
|
padding-right: Metrics.padding-md;
|
2024-04-09 21:12:54 +00:00
|
|
|
Text {
|
2024-04-10 10:34:47 +00:00
|
|
|
font-size: Metrics.font-md;
|
2024-04-09 21:12:54 +00:00
|
|
|
text: title;
|
|
|
|
vertical-alignment: center;
|
|
|
|
horizontal-alignment: title-alignment;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VerticalLayout {
|
|
|
|
padding: content-padding;
|
|
|
|
spacing: content-spacing;
|
|
|
|
@children
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|