diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-21 15:17:55 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-21 16:44:37 +0000 |
commit | 47e50cb3d0088e1080c98996601664119d3d588e (patch) | |
tree | db94cf91f79106417e4b2cc4c6d4e6d0988af22c /src/imports/controls/Popup.qml | |
parent | fec1a78618bae112ff8d1c0e6f078ea890cf283e (diff) |
Popup: fix margins
Change-Id: I09f974a00a5a2a8f14645ff5d9bfbd6bad03d324
Task-number: QTBUG-51990
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/Popup.qml')
-rw-r--r-- | src/imports/controls/Popup.qml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/imports/controls/Popup.qml b/src/imports/controls/Popup.qml index 60ea326a..309c317b 100644 --- a/src/imports/controls/Popup.qml +++ b/src/imports/controls/Popup.qml @@ -40,8 +40,10 @@ import Qt.labs.templates 1.0 as T T.Popup { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(background ? background.implicitWidth : 0, + contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) + implicitHeight: Math.max(background ? background.implicitHeight : 0, + contentWidth > 0 ? contentHeight + topPadding + bottomPadding : 0) contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) |