summaryrefslogtreecommitdiffstats
path: root/src/controls/GroupBox.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-28 10:19:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-29 12:36:35 +0200
commit6e62a72c72abc5ad6e241541208a36378d448853 (patch)
tree67aaf7f9ed7d941fb760b5852df1f4e5f10efb46 /src/controls/GroupBox.qml
parenta48849649e9d534449f6feb685dbb708f354d270 (diff)
Improved size calculation of GroupBox
This adds some pixel tweaks on mac, adds minimum size to fit the label and fixes dpi scaling on Windows Change-Id: I4c43ba4a7815be87356336a9dafc1a217437940b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/controls/GroupBox.qml')
-rw-r--r--src/controls/GroupBox.qml4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/controls/GroupBox.qml b/src/controls/GroupBox.qml
index 9bf1c0cc5..4aa6a50f4 100644
--- a/src/controls/GroupBox.qml
+++ b/src/controls/GroupBox.qml
@@ -159,7 +159,8 @@ Item {
/*! \internal */
property alias __style: styleLoader.item
- implicitWidth: (!anchors.fill ? container.calcWidth() : 0) + loader.leftMargin + loader.rightMargin
+ implicitWidth: Math.max((!anchors.fill ? container.calcWidth() : 0) + loader.leftMargin + loader.rightMargin,
+ sizeHint.implicitWidth + (checkable ? 24 : 6))
implicitHeight: (!anchors.fill ? container.calcHeight() : 0) + loader.topMargin + loader.bottomMargin
Layout.minimumWidth: implicitWidth
@@ -181,6 +182,7 @@ Item {
property int rightMargin: __style ? __style.padding.right : 0
sourceComponent: styleLoader.item ? styleLoader.item.panel : null
onLoaded: item.z = -1
+ Text { id: sizeHint ; visible: false ; text: title }
Loader {
id: styleLoader
property alias __control: groupbox