diff options
Diffstat (limited to 'src/imports/controls/material/ComboBox.qml')
-rw-r--r-- | src/imports/controls/material/ComboBox.qml | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 4b154182..fc284be1 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -115,6 +115,10 @@ T.ComboBox { //! [popup] popup: T.Popup { + y: control.height + implicitWidth: control.width + implicitHeight: Math.min(200, listview.contentHeight) + enter: Transition { // grow_fade_in NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 } @@ -127,18 +131,17 @@ T.ComboBox { 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 + contentItem: ListView { + id: listview + clip: true + model: control.delegateModel + currentIndex: control.highlightedIndex + transformOrigin: popup.showAbove ? Item.Bottom : Item.Top - x: below.x - y: showAbove ? above.y : below.y - width: control.width - height: listview.height - transformOrigin: showAbove ? Item.Bottom : Item.Top +// ScrollIndicator.vertical: ScrollIndicator { } + } + background: Item { Rectangle { id: panel width: parent.width @@ -156,18 +159,6 @@ T.ComboBox { samples: 15 spread: 0.5 } - - ListView { - id: listview - width: control.width - height: Math.min(200, contentHeight) // TODO: 396 - - clip: true - model: control.delegateModel - currentIndex: control.highlightedIndex - -// ScrollIndicator.vertical: ScrollIndicator { } - } } } //! [popup] |