Plasma-framework

GroupBox.qml
1/*
2 SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7import QtQuick
8import QtQuick.Controls
9import QtQuick.Templates as T
10import org.kde.ksvg as KSvg
11//NOTE: importing PlasmaCore is necessary in order to make KSvg load the current Plasma Theme
12import org.kde.plasma.core as PlasmaCore
13import org.kde.plasma.components as PlasmaComponents3
14
15T.GroupBox {
16 id: control
17
18 implicitWidth: contentWidth + leftPadding + rightPadding
19 implicitHeight: contentHeight + topPadding + bottomPadding
20
21 contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
22 contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
23
24 padding: 6
25 topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
26
27 label: PlasmaComponents3.Label {
28 x: control.leftPadding
29 width: control.availableWidth
30
31 text: control.title
32 font: control.font
33 enabled: control.enabled
34 elide: Text.ElideRight
35 horizontalAlignment: Text.AlignLeft
36 verticalAlignment: Text.AlignVCenter
37 }
38
39 background: KSvg.FrameSvgItem {
40 imagePath: "widgets/frame"
41 prefix: "plain"
42 }
43}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:54:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.