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 { ...@@ -32,7 +32,7 @@ T.ComboBox {
rightPadding: controlRoot.editable && !controlRoot.mirrored ? 24 : padding rightPadding: controlRoot.editable && !controlRoot.mirrored ? 24 : padding
delegate: ItemDelegate { delegate: ItemDelegate {
width: controlRoot.popup.width width: listView.width
text: controlRoot.textRole ? (Array.isArray(controlRoot.model) ? modelData[controlRoot.textRole] : model[controlRoot.textRole]) : modelData text: controlRoot.textRole ? (Array.isArray(controlRoot.model) ? modelData[controlRoot.textRole] : model[controlRoot.textRole]) : modelData
highlighted: mouseArea.pressed ? listView.currentIndex == index : controlRoot.highlightedIndex == index highlighted: mouseArea.pressed ? listView.currentIndex == index : controlRoot.highlightedIndex == index
property bool separatorVisible: false property bool separatorVisible: false
...@@ -205,7 +205,10 @@ T.ComboBox { ...@@ -205,7 +205,10 @@ T.ComboBox {
// like ApplicationWindow, which we don't want. // like ApplicationWindow, which we don't want.
Controls.Overlay.modal: Item { } Controls.Overlay.modal: Item { }
contentItem: ListView { contentItem: ScrollView {
background: Rectangle {}
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ListView {
id: listView id: listView
// this causes us to load at least one delegate // this causes us to load at least one delegate
...@@ -220,7 +223,7 @@ T.ComboBox { ...@@ -220,7 +223,7 @@ T.ComboBox {
highlightRangeMode: ListView.ApplyRange highlightRangeMode: ListView.ApplyRange
highlightMoveDuration: 0 highlightMoveDuration: 0
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
T.ScrollBar.vertical: Controls.ScrollBar { } }
} }
background: Kirigami.ShadowedRectangle { background: Kirigami.ShadowedRectangle {
anchors { 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