| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | import { FluentFontSettings, FluentPalette } from "styling.slint" ; |
| 5 | |
| 6 | export component GroupBox { |
| 7 | in property <string> title <=> label.text; |
| 8 | in property <bool> enabled: true; |
| 9 | |
| 10 | accessible-role: groupbox; |
| 11 | accessible-label: root.title; |
| 12 | accessible-enabled: root.enabled; |
| 13 | |
| 14 | VerticalLayout { |
| 15 | spacing: 8px; |
| 16 | padding-top: 16px; |
| 17 | padding-bottom: 8px; |
| 18 | |
| 19 | label := Text { |
| 20 | vertical-stretch: 0; |
| 21 | color: !root.enabled ? FluentPalette.text-disabled : FluentPalette.control-foreground; |
| 22 | font-size: FluentFontSettings.body-strong.font-size; |
| 23 | font-weight: FluentFontSettings.body-strong.font-weight; |
| 24 | } |
| 25 | |
| 26 | Rectangle { |
| 27 | vertical-stretch: 1; |
| 28 | |
| 29 | GridLayout { |
| 30 | @children |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |