mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 21:04:47 +00:00
45 lines
1.2 KiB
Text
45 lines
1.2 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
|
|
import { md } from "md.slint";
|
|
|
|
// A container widget with a title.
|
|
export component GroupBox {
|
|
in property <string> title <=> label.text;
|
|
in property<bool> enabled: true;
|
|
|
|
VerticalLayout {
|
|
spacing: 4px;
|
|
|
|
label := Text {
|
|
color: md.sys.color.on-surface;
|
|
// FIXME after Roboto font can be loaded
|
|
//font-family: md.sys.typescale.body-small.font;
|
|
font-size: md.sys.typescale.body-large.size;
|
|
font-weight: md.sys.typescale.body-small.weight;
|
|
overflow: elide;
|
|
horizontal-alignment: center;
|
|
}
|
|
|
|
container := Rectangle {
|
|
border-radius: 16px;
|
|
border-width: 1px;
|
|
border-color: md.sys.color.outline;
|
|
vertical-stretch: 1;
|
|
background: md.sys.color.surface;
|
|
|
|
GridLayout {
|
|
padding: 16px;
|
|
@children
|
|
}
|
|
}
|
|
}
|
|
|
|
states [
|
|
disabled when !root.enabled : {
|
|
container.border-color: md.sys.color.on-surface;
|
|
container.opacity: 0.38;
|
|
label.opacity: 0.38;
|
|
}
|
|
]
|
|
}
|