// SPDX-FileCopyrightText: 2024 vivi developers // SPDX-License-Identifier: MIT import { BorderStyle, Border, GroupBoxBase } from "../foundation.slint"; import { MagicPalette, MagicFontSettings, MagicLayoutSettings, MagicBorderSettings } from "./styling.slint"; import { MagicText } from "./magic_text.slint"; export component GroupBox inherits GroupBoxBase { style: { border_style: { background: MagicPalette.alternate_background, border_radius: MagicBorderSettings.control_border_radius, border_width: MagicBorderSettings.control_border_width, border_brush: MagicPalette.border }, spacing: MagicLayoutSettings.control_spacing, padding: MagicLayoutSettings.control_padding, title_style: MagicFontSettings.header_3, }; VerticalLayout { spacing: root.style.spacing; MagicText { text: root.title; style: root.style.title_style; horizontal_alignment: root.style.title_horizontal_alignment; vertical_stretch: 0; } background_layer := Border { vertical_stretch: 1; style: root.style.border_style; GridLayout { padding: root.style.padding; @children } } } }