Skip to content

Commit dd6a02b

Browse files
committed
fix(gui): resize share search results list dependent on required space
In the case there are more search results present than there's space for it, always display a scrollbar. Some QtQuick themes don't make it obvious that the list is scrollable. Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
1 parent 24536d7 commit dd6a02b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/gui/filedetails/ShareeSearchField.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,18 @@ TextField {
152152
id: suggestionsPopup
153153

154154
width: root.width
155-
height: 100
156155
y: root.height
157156

158157
contentItem: ScrollView {
159158
id: suggestionsScrollView
160159

161160
clip: true
162161
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
162+
ScrollBar.vertical.policy: shareeListView.contentHeight > shareeListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
163+
164+
// need to take the popup's padding in account for the max height
165+
// remove bottomPadding twice to leave some space between the window border
166+
implicitHeight: Math.min(Window.height - parent.y - parent.topPadding - parent.bottomPadding * 2, contentHeight)
163167

164168
ListView {
165169
id: shareeListView

0 commit comments

Comments
 (0)