mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 04:45:13 +00:00

* Add material Switch * Add fluent switch * Add native Switch and cleanup * Rebase fix * Update internal/compiler/widgets/fluent-base/std-widgets-impl.slint Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com> * Code review * Update docs/language/src/builtins/widgets.md Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com> * Update docs/language/src/builtins/widgets.md Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com> * Code review * Update docs/language/src/builtins/widgets.md Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com> * Update examples/gallery/ui/pages/controls_page.slint Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com> * Code review tweak on gallery layout * Code review tweak on gallery layout --------- Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
48 lines
1.3 KiB
Text
48 lines
1.3 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;
|
|
|
|
HorizontalLayout {
|
|
padding: 16px;
|
|
|
|
GridLayout {
|
|
@children
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
states [
|
|
disabled when !root.enabled : {
|
|
container.border-color: md.sys.color.on-surface;
|
|
container.opacity: 0.38;
|
|
label.opacity: 0.38;
|
|
}
|
|
]
|
|
}
|