diff options
Diffstat (limited to 'src/imports/controls/GroupBox.qml')
-rw-r--r-- | src/imports/controls/GroupBox.qml | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml index bc1801c2..31f4963f 100644 --- a/src/imports/controls/GroupBox.qml +++ b/src/imports/controls/GroupBox.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Labs Controls module of the Qt Toolkit. +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage @@ -35,7 +35,7 @@ ****************************************************************************/ import QtQuick 2.6 -import Qt.labs.templates 1.0 as T +import QtQuick.Templates 2.0 as T T.GroupBox { id: control @@ -49,14 +49,11 @@ T.GroupBox { contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) spacing: 6 - padding: 6 - topPadding: 6 + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) + padding: 12 + topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) - //! [contentItem] contentItem: Item { } - //! [contentItem] - //! [label] label: Text { x: control.leftPadding width: control.availableWidth @@ -68,10 +65,8 @@ T.GroupBox { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } - //! [label] - //! [frame] - frame: Rectangle { + background: Rectangle { y: control.topPadding - control.padding width: parent.width height: parent.height - control.topPadding + control.padding @@ -79,5 +74,4 @@ T.GroupBox { color: "transparent" border.color: "#bdbebf" } - //! [frame] } |