From 6e62a72c72abc5ad6e241541208a36378d448853 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 28 May 2013 10:19:30 +0200 Subject: 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 --- src/controls/GroupBox.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/controls/GroupBox.qml') diff --git a/src/controls/GroupBox.qml b/src/controls/GroupBox.qml index 9bf1c0cc..4aa6a50f 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 -- cgit v1.2.1