diff --git a/org.kde.desktop/ComboBox.qml b/org.kde.desktop/ComboBox.qml index c54958ead00e1973f6a868419a88b0884a118092..9d688551ae7c0ad56881b8a76712f9809d82cec2 100644 --- a/org.kde.desktop/ComboBox.qml +++ b/org.kde.desktop/ComboBox.qml @@ -32,7 +32,7 @@ T.ComboBox { rightPadding: controlRoot.editable && !controlRoot.mirrored ? 24 : padding delegate: ItemDelegate { - width: controlRoot.popup.width + width: listView.width text: controlRoot.textRole ? (Array.isArray(controlRoot.model) ? modelData[controlRoot.textRole] : model[controlRoot.textRole]) : modelData highlighted: mouseArea.pressed ? listView.currentIndex == index : controlRoot.highlightedIndex == index property bool separatorVisible: false @@ -205,22 +205,25 @@ T.ComboBox { // like ApplicationWindow, which we don't want. Controls.Overlay.modal: Item { } - contentItem: ListView { - id: listView - - // this causes us to load at least one delegate - // this is essential in guessing the contentHeight - // which is needed to initially resize the popup - cacheBuffer: 1 - - implicitHeight: contentHeight - model: controlRoot.delegateModel - delegate: controlRoot.delegate - currentIndex: controlRoot.highlightedIndex - highlightRangeMode: ListView.ApplyRange - highlightMoveDuration: 0 - boundsBehavior: Flickable.StopAtBounds - T.ScrollBar.vertical: Controls.ScrollBar { } + contentItem: ScrollView { + background: Rectangle {} + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ListView { + id: listView + + // this causes us to load at least one delegate + // this is essential in guessing the contentHeight + // which is needed to initially resize the popup + cacheBuffer: 1 + + implicitHeight: contentHeight + model: controlRoot.delegateModel + delegate: controlRoot.delegate + currentIndex: controlRoot.highlightedIndex + highlightRangeMode: ListView.ApplyRange + highlightMoveDuration: 0 + boundsBehavior: Flickable.StopAtBounds + } } background: Kirigami.ShadowedRectangle { anchors {