mirai/lib/slint-vynui/LabeledComponent.slint

23 lines
454 B
Text
Raw Normal View History

2024-08-16 21:35:12 +02:00
import { Palette } from "Palette.slint";
import { VText } from "Text.slint";
export component VLabeledComponent {
in property<string> label <=> labelComponent.text;
in property<bool> enabled: true;
VerticalLayout {
labelComponent := VText {
}
Rectangle {
background: enabled ? Palette.control-background : Palette.control-background.darker(0.2);
border-radius: 4px;
VerticalLayout {
padding: 4px;
@children
}
}
}
}