From fe0140f8fe8c3b44fa7716c531a98c3b66746a01 Mon Sep 17 00:00:00 2001 From: Jyrki Gadinger Date: Thu, 24 Apr 2025 13:20:46 +0200 Subject: [PATCH] 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 --- src/gui/filedetails/ShareeSearchField.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/filedetails/ShareeSearchField.qml b/src/gui/filedetails/ShareeSearchField.qml index da82731c51cc1..0eedb86e4dad9 100644 --- a/src/gui/filedetails/ShareeSearchField.qml +++ b/src/gui/filedetails/ShareeSearchField.qml @@ -152,7 +152,6 @@ TextField { id: suggestionsPopup width: root.width - height: 100 y: root.height contentItem: ScrollView { @@ -160,6 +159,11 @@ TextField { clip: true ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + ScrollBar.vertical.policy: shareeListView.contentHeight > shareeListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff + + // need to take the popup's padding in account for the max height + // remove bottomPadding twice to leave some space between the window border + implicitHeight: Math.min(Window.height - parent.y - parent.topPadding - parent.bottomPadding * 2, contentHeight) ListView { id: shareeListView