From 20693999790a4f2e627254558208e1099b9bcec4 Mon Sep 17 00:00:00 2001 From: Michal Iskierko Date: Tue, 12 Apr 2022 17:06:22 +0200 Subject: [PATCH] fix(StatusTagSelector): Fix displaying a list of contacts in StatusTagSelector Fix #5465 --- src/StatusQ/Components/StatusTagSelector.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/StatusQ/Components/StatusTagSelector.qml b/src/StatusQ/Components/StatusTagSelector.qml index f1284a92..c84c30fc 100644 --- a/src/StatusQ/Components/StatusTagSelector.qml +++ b/src/StatusQ/Components/StatusTagSelector.qml @@ -60,8 +60,9 @@ Item { id: root implicitWidth: 448 - implicitHeight: 44 + ((userListView.count > 0) ? 44 + contactsLabel.height + contactsLabel.anchors.topMargin + ((((userListView.count * 64) > root.maxHeight) - ? root.maxHeight : (userListView.count * 64))) :0) + implicitHeight: 44 + ((userListView.model.count > 0) ? 44 + contactsLabel.height + contactsLabel.anchors.topMargin + + ((((userListView.model.count * 64) > root.maxHeight) ? root.maxHeight : (userListView.model.count * 64))) :0) + /*! \qmlproperty real StatusTagSelector::maxHeight This property holds the maximum height of the component. @@ -139,9 +140,9 @@ Item { for (var i = 0; i < inputModel.count; i++ ) { var entry = inputModel.get(i); if (entry.name.toLowerCase().includes(text.toLowerCase())) { - sortedList.insert(sortedList.count, {"publicId": entry.publicId, "name": entry.name, - "icon": entry.icon, "isIdenticon": entry.isIdenticon, - "onlineStatus": entry.onlineStatus}); + sortedList.append({"publicId": entry.publicId, "name": entry.name, + "icon": entry.icon, "isIdenticon": entry.isIdenticon, + "onlineStatus": entry.onlineStatus}); userListView.model = sortedList; } }