From 3ff90d10748957eabc1c5bab735c3689b6d59379 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 14 Jul 2020 17:17:27 -0400 Subject: [PATCH] Fix avatar membership icon position in narrow pane --- src/gui/Base/HUserAvatar.qml | 4 ++-- src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/Base/HUserAvatar.qml b/src/gui/Base/HUserAvatar.qml index 7f9c0ebe..1aac00b1 100644 --- a/src/gui/Base/HUserAvatar.qml +++ b/src/gui/Base/HUserAvatar.qml @@ -7,7 +7,7 @@ HAvatar { property string displayName property string presence: "" property int powerLevel: 0 - property bool shiftMembershipIconPosition: true + property int shiftMembershipIconPositionBy: -8 property bool invited: false readonly property bool admin: powerLevel >= 100 @@ -21,7 +21,7 @@ HAvatar { active: admin || moderator || invited anchors.top: parent.top anchors.left: parent.left - anchors.topMargin: shiftMembershipIconPosition ? -16 / 2 : 0 + anchors.topMargin: shiftMembershipIconPositionBy anchors.leftMargin: anchors.topMargin z: 100 diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml index 6430332d..b60fa42c 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml @@ -23,10 +23,11 @@ HTile { displayName: model.display_name mxc: model.avatar_url powerLevel: model.power_level - shiftMembershipIconPosition: ! roomPane.collapsed invited: model.invited compact: member.compact presence: model.presence + shiftMembershipIconPositionBy: + roomPane.width >= width + 8 * 3 ? -8 : -4 } HColumnLayout {