diff --git a/src/qml/Chat/RoomSidePane/MemberDelegate.qml b/src/qml/Chat/RoomSidePane/MemberDelegate.qml index 8695ed8d..d3ffddab 100644 --- a/src/qml/Chat/RoomSidePane/MemberDelegate.qml +++ b/src/qml/Chat/RoomSidePane/MemberDelegate.qml @@ -5,35 +5,42 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 import "../../Base" -MouseArea { +HHighlightRectangle { id: memberDelegate width: memberList.width height: childrenRect.height property var memberInfo: users.find(model.userId) - HRowLayout { - width: parent.width - spacing: memberList.spacing + Row { + width: parent.width - leftPadding * 2 + padding: roomSidePane.currentSpacing / 2 + leftPadding: roomSidePane.currentSpacing + rightPadding: 0 - HUserAvatar { - id: avatar - userId: model.userId - } + HRowLayout { + width: parent.width + spacing: roomSidePane.currentSpacing - HColumnLayout { - Layout.fillWidth: true - Layout.maximumWidth: - parent.width - parent.totalSpacing - avatar.width + HUserAvatar { + id: avatar + userId: model.userId + } - HLabel { - id: memberName - text: memberInfo.displayName || model.userId - elide: Text.ElideRight - maximumLineCount: 1 - verticalAlignment: Qt.AlignVCenter + HColumnLayout { + Layout.fillWidth: true + Layout.maximumWidth: + parent.width - parent.totalSpacing - avatar.width - Layout.maximumWidth: parent.width + HLabel { + id: memberName + text: memberInfo.displayName || model.userId + elide: Text.ElideRight + maximumLineCount: 1 + verticalAlignment: Qt.AlignVCenter + + Layout.maximumWidth: parent.width + } } } } diff --git a/src/qml/Chat/RoomSidePane/MembersView.qml b/src/qml/Chat/RoomSidePane/MembersView.qml index e8c5ffe5..a02f6627 100644 --- a/src/qml/Chat/RoomSidePane/MembersView.qml +++ b/src/qml/Chat/RoomSidePane/MembersView.qml @@ -8,19 +8,9 @@ import "../../Base" import "../../utils.js" as Utils HColumnLayout { - property bool collapsed: false - property int normalSpacing: collapsed ? 0 : 8 - - Behavior on normalSpacing { HNumberAnimation {} } - HListView { id: memberList - - spacing: normalSpacing - topMargin: normalSpacing - bottomMargin: normalSpacing - Layout.leftMargin: normalSpacing - Layout.rightMargin: normalSpacing + bottomMargin: currentSpacing model: HListModel { sourceModel: chatPage.roomInfo.members diff --git a/src/qml/Chat/RoomSidePane/RoomSidePane.qml b/src/qml/Chat/RoomSidePane/RoomSidePane.qml index 93df0312..f6bd9c1d 100644 --- a/src/qml/Chat/RoomSidePane/RoomSidePane.qml +++ b/src/qml/Chat/RoomSidePane/RoomSidePane.qml @@ -11,8 +11,12 @@ HRectangle { property bool collapsed: false property var activeView: null + property int normalSpacing: 8 + readonly property int currentSpacing: collapsed ? 0 : normalSpacing + + Behavior on normalSpacing { HNumberAnimation {} } + MembersView { anchors.fill: parent - collapsed: parent.collapsed } } diff --git a/src/qml/SidePane/RoomDelegate.qml b/src/qml/SidePane/RoomDelegate.qml index 0201a458..d2508988 100644 --- a/src/qml/SidePane/RoomDelegate.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -18,7 +18,7 @@ HHighlightRectangle { } Row { - width: parent.width - sidePane.currentSpacing * 2 + width: parent.width - leftPadding * 2 padding: sidePane.currentSpacing / 2 leftPadding: sidePane.currentSpacing rightPadding: 0 diff --git a/src/qml/SidePane/SidePane.qml b/src/qml/SidePane/SidePane.qml index f5cf581e..db362bcc 100644 --- a/src/qml/SidePane/SidePane.qml +++ b/src/qml/SidePane/SidePane.qml @@ -11,9 +11,9 @@ HRectangle { // Avoid artifacts when collapsed clip: true - property int normalSpacing: 8 - property int currentSpacing: collapsed ? 0 : normalSpacing property bool collapsed: false + property int normalSpacing: 8 + readonly property int currentSpacing: collapsed ? 0 : normalSpacing HColumnLayout { anchors.fill: parent