Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/GroupBox.qml
Show All 17 Lines | |||||
18 | * ensure the GNU General Public License version 2.0 requirements will be | 18 | * ensure the GNU General Public License version 2.0 requirements will be | ||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | 19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | import QtQuick 2.6 | 23 | import QtQuick 2.6 | ||
24 | import QtQuick.Controls 2.0 | 24 | import QtQuick.Controls 2.0 | ||
25 | import QtQuick.Templates 2.0 as T | 25 | import QtQuick.Templates 2.0 as T | ||
26 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | 26 | import org.kde.kirigami 2.2 as Kirigami | ||
27 | 27 | | |||
28 | T.GroupBox { | 28 | T.GroupBox { | ||
29 | id: control | 29 | id: control | ||
30 | 30 | | |||
31 | implicitWidth: contentWidth + leftPadding + rightPadding | 31 | implicitWidth: contentWidth + leftPadding + rightPadding | ||
32 | implicitHeight: contentHeight + topPadding + bottomPadding | 32 | implicitHeight: contentHeight + topPadding + bottomPadding | ||
33 | 33 | | |||
34 | contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) | 34 | contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) | ||
35 | contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) | 35 | contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) | ||
36 | 36 | | |||
37 | padding: 6 | 37 | padding: 6 | ||
38 | topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) | 38 | topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) | ||
39 | 39 | | |||
40 | label: Label { | 40 | label: Label { | ||
41 | x: control.leftPadding | 41 | x: control.leftPadding | ||
42 | width: control.availableWidth | 42 | width: control.availableWidth | ||
43 | 43 | | |||
44 | text: control.title | 44 | text: control.title | ||
45 | font: control.font | 45 | font: control.font | ||
46 | color: StylePrivate.SystemPaletteSingleton.text(control.enabled) | 46 | color: Kirigami.Theme.textColor | ||
47 | elide: Text.ElideRight | 47 | elide: Text.ElideRight | ||
48 | horizontalAlignment: Text.AlignLeft | 48 | horizontalAlignment: Text.AlignLeft | ||
49 | verticalAlignment: Text.AlignVCenter | 49 | verticalAlignment: Text.AlignVCenter | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | background: Rectangle { | 52 | background: Rectangle { | ||
53 | color: "transparent" | 53 | color: "transparent" | ||
54 | property color borderColor: StylePrivate.SystemPaletteSingleton.text(control.enabled) | 54 | property color borderColor: Kirigami.Theme.textColor | ||
55 | border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3) | 55 | border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3) | ||
56 | } | 56 | } | ||
57 | } | 57 | } |