QmlDesigner: Add scroll bars to SuggestionPopup

* Add scroll bars
* Fix focus style for expression builder

Change-Id: I08f4334b3d480e4395a0c017634dd42f8eff74bb
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2023-09-14 11:35:01 +02:00
committed by Henning Gründl
parent 89d5795f7a
commit 650dabdc25
2 changed files with 37 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ Rectangle {
if (!root.conditionListModel.valid)
return StudioTheme.Values.themeError
if (focusScope.activeFocus || popup.searchActive)
if (focusScope.activeFocus)
return root.style.border.interaction
if (mouseArea.containsMouse)

View File

@@ -124,10 +124,27 @@ Controls.Popup {
id: listView
visible: search.empty
width: stack.width
implicitHeight: Math.min(380, childrenRect.height)
implicitHeight: Math.min(180, childrenRect.height)
clip: true
model: root.listModel
HoverHandler { id: listViewHoverHandler }
boundsMovement: Flickable.StopAtBounds
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: HelperWidgets.ScrollBar {
id: listScrollBar
parent: listView
x: listView.width - listScrollBar.width
y: 0
height: listView.availableHeight
orientation: Qt.Vertical
show: (listViewHoverHandler.hovered || listView.focus || listScrollBar.inUse)
&& listScrollBar.isNeeded
}
delegate: MyListViewDelegate {
id: listViewDelegate
@@ -167,10 +184,27 @@ Controls.Popup {
id: treeView
visible: !search.empty
width: stack.width
implicitHeight: Math.min(380, childrenRect.height)
implicitHeight: Math.min(180, childrenRect.height)
clip: true
model: root.treeModel
HoverHandler { id: treeViewHoverHandler }
boundsMovement: Flickable.StopAtBounds
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: HelperWidgets.ScrollBar {
id: treeScrollBar
parent: treeView
x: treeView.width - treeScrollBar.width
y: 0
height: treeView.availableHeight
orientation: Qt.Vertical
show: (treeViewHoverHandler.hovered || treeView.focus || treeScrollBar.inUse)
&& treeScrollBar.isNeeded
}
onLayoutChanged: function() {
treeView.expand(0)
}