forked from qt-creator/qt-creator
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:
committed by
Henning Gründl
parent
89d5795f7a
commit
650dabdc25
@@ -54,7 +54,7 @@ Rectangle {
|
|||||||
if (!root.conditionListModel.valid)
|
if (!root.conditionListModel.valid)
|
||||||
return StudioTheme.Values.themeError
|
return StudioTheme.Values.themeError
|
||||||
|
|
||||||
if (focusScope.activeFocus || popup.searchActive)
|
if (focusScope.activeFocus)
|
||||||
return root.style.border.interaction
|
return root.style.border.interaction
|
||||||
|
|
||||||
if (mouseArea.containsMouse)
|
if (mouseArea.containsMouse)
|
||||||
|
@@ -124,10 +124,27 @@ Controls.Popup {
|
|||||||
id: listView
|
id: listView
|
||||||
visible: search.empty
|
visible: search.empty
|
||||||
width: stack.width
|
width: stack.width
|
||||||
implicitHeight: Math.min(380, childrenRect.height)
|
implicitHeight: Math.min(180, childrenRect.height)
|
||||||
clip: true
|
clip: true
|
||||||
model: root.listModel
|
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 {
|
delegate: MyListViewDelegate {
|
||||||
id: listViewDelegate
|
id: listViewDelegate
|
||||||
|
|
||||||
@@ -167,10 +184,27 @@ Controls.Popup {
|
|||||||
id: treeView
|
id: treeView
|
||||||
visible: !search.empty
|
visible: !search.empty
|
||||||
width: stack.width
|
width: stack.width
|
||||||
implicitHeight: Math.min(380, childrenRect.height)
|
implicitHeight: Math.min(180, childrenRect.height)
|
||||||
clip: true
|
clip: true
|
||||||
model: root.treeModel
|
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() {
|
onLayoutChanged: function() {
|
||||||
treeView.expand(0)
|
treeView.expand(0)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user