fmeditor-slint/ui/widgets/panel.slint

38 lines
1.1 KiB
Plaintext
Raw Normal View History

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;
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;
border-radius: Metrics.radius-md;
2024-04-09 21:12:54 +00:00
clip: true;
VerticalLayout {
Rectangle {
height: Metrics.size-md;
2024-04-09 21:12:54 +00:00
border-color: black;
border-width: 1px;
HorizontalLayout {
padding-left: Metrics.padding-md;
padding-right: Metrics.padding-md;
2024-04-09 21:12:54 +00:00
Text {
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
}
}
}