Fix avatar membership icon position in narrow pane

This commit is contained in:
miruka 2020-07-14 17:17:27 -04:00
parent d092cd6506
commit 3ff90d1074
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ HAvatar {
property string displayName property string displayName
property string presence: "" property string presence: ""
property int powerLevel: 0 property int powerLevel: 0
property bool shiftMembershipIconPosition: true property int shiftMembershipIconPositionBy: -8
property bool invited: false property bool invited: false
readonly property bool admin: powerLevel >= 100 readonly property bool admin: powerLevel >= 100
@ -21,7 +21,7 @@ HAvatar {
active: admin || moderator || invited active: admin || moderator || invited
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: shiftMembershipIconPosition ? -16 / 2 : 0 anchors.topMargin: shiftMembershipIconPositionBy
anchors.leftMargin: anchors.topMargin anchors.leftMargin: anchors.topMargin
z: 100 z: 100

View File

@ -23,10 +23,11 @@ HTile {
displayName: model.display_name displayName: model.display_name
mxc: model.avatar_url mxc: model.avatar_url
powerLevel: model.power_level powerLevel: model.power_level
shiftMembershipIconPosition: ! roomPane.collapsed
invited: model.invited invited: model.invited
compact: member.compact compact: member.compact
presence: model.presence presence: model.presence
shiftMembershipIconPositionBy:
roomPane.width >= width + 8 * 3 ? -8 : -4
} }
HColumnLayout { HColumnLayout {