From 915c96f174c3bed17054d41db056ff63f7f02dc5 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 4 Dec 2019 09:17:13 -0400 Subject: [PATCH] Fix power icons position when room pane collapsed --- src/qml/Base/HUserAvatar.qml | 5 ++++- src/qml/Chat/RoomSidePane/MemberDelegate.qml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qml/Base/HUserAvatar.qml b/src/qml/Base/HUserAvatar.qml index 1ced9fe1..94501230 100644 --- a/src/qml/Base/HUserAvatar.qml +++ b/src/qml/Base/HUserAvatar.qml @@ -7,6 +7,7 @@ HAvatar { property string userId property string displayName property int powerLevel: 0 + property bool shiftPowerIconPosition: true readonly property bool admin: powerLevel >= 100 readonly property bool moderator: powerLevel >= 50 && ! admin @@ -16,10 +17,12 @@ HAvatar { active: admin || moderator anchors.top: parent.top anchors.left: parent.left - anchors.topMargin: -16 / 2 + anchors.topMargin: shiftPowerIconPosition ? -16 / 2 : 0 anchors.leftMargin: anchors.topMargin z: 100 + Behavior on anchors.topMargin { HNumberAnimation {} } + sourceComponent: HIcon { small: true svgName: "user-power-" + (admin ? "100" : "50") diff --git a/src/qml/Chat/RoomSidePane/MemberDelegate.qml b/src/qml/Chat/RoomSidePane/MemberDelegate.qml index 5864fb25..3cd6f89f 100644 --- a/src/qml/Chat/RoomSidePane/MemberDelegate.qml +++ b/src/qml/Chat/RoomSidePane/MemberDelegate.qml @@ -12,6 +12,7 @@ HTileDelegate { displayName: model.display_name mxc: model.avatar_url powerLevel: model.power_level + shiftPowerIconPosition: ! roomSidePane.collapsed } title.text: model.display_name || model.user_id