From b4df752f8a36b46d5824a4573c5fa0bae0bbbfe9 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 21 Dec 2019 12:46:47 -0400 Subject: [PATCH] Improve MembersView when RoomPane collapsed --- src/gui/Base/HTile.qml | 2 ++ src/gui/Pages/Chat/RoomPane/MemberDelegate.qml | 7 +++++++ src/gui/Pages/Chat/RoomPane/RoomPane.qml | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/src/gui/Base/HTile.qml b/src/gui/Base/HTile.qml index c47fc295..7e1b3250 100644 --- a/src/gui/Base/HTile.qml +++ b/src/gui/Base/HTile.qml @@ -17,6 +17,7 @@ HButton { readonly property alias additionalInfo: additionalInfo readonly property alias rightInfo: rightInfo readonly property alias subtitle: subtitle + readonly property Item loadedImage: imageLoader.item property alias contextMenu: contextMenuLoader.sourceComponent @@ -28,6 +29,7 @@ HButton { opacity: tile.contentOpacity HLoader { + id: imageLoader sourceComponent: image } diff --git a/src/gui/Pages/Chat/RoomPane/MemberDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberDelegate.qml index b19b2eb9..384ef55f 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberDelegate.qml @@ -38,4 +38,11 @@ HTileDelegate { Behavior on title.color { HColorAnimation {} } Behavior on contentOpacity { HNumberAnimation {} } + Behavior on spacing { HNumberAnimation {} } + + Binding on spacing { + value: (roomPane.minimumSize - loadedImage.width) / 2 + when: loadedImage && + roomPane.width < loadedImage.width + theme.spacing * 2 + } } diff --git a/src/gui/Pages/Chat/RoomPane/RoomPane.qml b/src/gui/Pages/Chat/RoomPane/RoomPane.qml index 15ebd457..9e1496e8 100644 --- a/src/gui/Pages/Chat/RoomPane/RoomPane.qml +++ b/src/gui/Pages/Chat/RoomPane/RoomPane.qml @@ -30,6 +30,11 @@ HDrawer { } } + + readonly property alias buttonRepeater: buttonRepeater + readonly property alias swipeView: swipeView + + HColumnLayout { anchors.fill: parent