aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/Popup.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-23 14:16:22 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-23 13:37:25 +0000
commitb9f5c47114c94974fcfe748057ffa8971b491e34 (patch)
tree38a7ac7dc1230ff6176fb15c1cdfc09c74d5f8c6 /src/imports/controls/material/Popup.qml
parent312eb820c0b7435c933b29b022d35ed928b6c096 (diff)
Popup: add implicit & content sizes
Behaves the same way than the Pane/Frame/GroupBox container controls. Change-Id: I370f3961b77a363a63a0a64fc629cc5da6dfd53f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/material/Popup.qml')
-rw-r--r--src/imports/controls/material/Popup.qml11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml
index 8eb56a01..b1c73b0c 100644
--- a/src/imports/controls/material/Popup.qml
+++ b/src/imports/controls/material/Popup.qml
@@ -42,10 +42,11 @@ import Qt.labs.controls.material 1.0
T.Popup {
id: control
- width: Math.max(background ? background.implicitWidth : 0,
- contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
- height: Math.max(background ? background.implicitHeight : 0,
- contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0)
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
+
+ contentWidth: contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0
+ contentHeight: contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0
padding: 6
@@ -61,6 +62,8 @@ T.Popup {
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
}
+ contentItem: Item { }
+
background: Rectangle {
radius: 3
color: control.Material.dialogColor