From fd7bd4ec5116fd543ad21a6a63969f08deac4925 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 19 Apr 2018 11:49:52 +0200 Subject: Dial: follow the "standard" implicit size calculation practices Change-Id: I9a08ebd646a720707ed70180b68942be378265b9 Reviewed-by: Mitch Curtis --- src/imports/controls/universal/Dial.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/imports/controls/universal/Dial.qml') diff --git a/src/imports/controls/universal/Dial.qml b/src/imports/controls/universal/Dial.qml index ffeee7c1..118bb38b 100644 --- a/src/imports/controls/universal/Dial.qml +++ b/src/imports/controls/universal/Dial.qml @@ -41,10 +41,15 @@ import QtQuick.Controls.Universal 2.5 T.Dial { id: control - implicitWidth: 100 - implicitHeight: 100 + implicitWidth: Math.max(implicitBackgroundWidth, + implicitContentWidth + leftPadding + rightPadding) || 100 // ### remove 100 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight, + implicitContentHeight + topPadding + bottomPadding) || 100 // ### remove 100 in Qt 6 background: Rectangle { + implicitWidth: 100 + implicitHeight: 100 + x: control.width / 2 - width / 2 y: control.height / 2 - height / 2 width: Math.max(64, Math.min(control.width, control.height)) -- cgit v1.2.3