diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-19 19:42:17 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-19 20:44:56 +0000 |
commit | 1a65814fdc08ba134db422c1c3fb214a1857d30d (patch) | |
tree | 4c98b5e655988bb6c0621c69b0b531eb4d0be445 /src/imports | |
parent | 3dde45b6d10031f099b11425976b805d285ecbbf (diff) |
Material: set transitions for ComboBox popup
Change-Id: I24b7a05224073d5094b92f49ef7f1c908dac806b
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/controls/material/ComboBox.qml | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index c1b7d132..93494a60 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -114,15 +114,29 @@ T.ComboBox { //! [popup] popup: T.Popup { + enter: Transition { + // grow_fade_in + NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 } + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 } + } + + exit: Transition { + // shrink_fade_out + NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 } + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 } + } + contentItem: Item { // TODO: Popup::anchors readonly property var above: popup.visible ? control.mapToItem(null, 0, -height) : Qt.point(0, 0) readonly property var below: popup.visible ? control.mapToItem(null, 0, control.height) : Qt.point(0, 0) + readonly property bool showAbove: above.y >= 0 && below.y + height > control.Window.height x: below.x - y: above.y >= 0 && below.y + height > control.Window.height ? above.y : below.y + y: showAbove ? above.y : below.y width: control.width height: listview.height + transformOrigin: showAbove ? Item.Bottom : Item.Top Rectangle { id: panel |