Commit c7ee522c authored by David Redondo's avatar David Redondo 🏎
Browse files

Prevent delegates and scrollbar overlapping in combobox popups

Attached scrollbar is positioned inside the ListView, use a ScrollView instead
parent c2497012
......@@ -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,7 +205,10 @@ T.ComboBox {
// like ApplicationWindow, which we don't want.
Controls.Overlay.modal: Item { }
contentItem: ListView {
contentItem: ScrollView {
background: Rectangle {}
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ListView {
id: listView
// this causes us to load at least one delegate
......@@ -220,7 +223,7 @@ T.ComboBox {
highlightRangeMode: ListView.ApplyRange
highlightMoveDuration: 0
boundsBehavior: Flickable.StopAtBounds
T.ScrollBar.vertical: Controls.ScrollBar { }
}
}
background: Kirigami.ShadowedRectangle {
anchors {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment