Fix power icons position when room pane collapsed
This commit is contained in:
parent
34e0ec7c7d
commit
915c96f174
|
@ -7,6 +7,7 @@ HAvatar {
|
||||||
property string userId
|
property string userId
|
||||||
property string displayName
|
property string displayName
|
||||||
property int powerLevel: 0
|
property int powerLevel: 0
|
||||||
|
property bool shiftPowerIconPosition: true
|
||||||
|
|
||||||
readonly property bool admin: powerLevel >= 100
|
readonly property bool admin: powerLevel >= 100
|
||||||
readonly property bool moderator: powerLevel >= 50 && ! admin
|
readonly property bool moderator: powerLevel >= 50 && ! admin
|
||||||
|
@ -16,10 +17,12 @@ HAvatar {
|
||||||
active: admin || moderator
|
active: admin || moderator
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.topMargin: -16 / 2
|
anchors.topMargin: shiftPowerIconPosition ? -16 / 2 : 0
|
||||||
anchors.leftMargin: anchors.topMargin
|
anchors.leftMargin: anchors.topMargin
|
||||||
z: 100
|
z: 100
|
||||||
|
|
||||||
|
Behavior on anchors.topMargin { HNumberAnimation {} }
|
||||||
|
|
||||||
sourceComponent: HIcon {
|
sourceComponent: HIcon {
|
||||||
small: true
|
small: true
|
||||||
svgName: "user-power-" + (admin ? "100" : "50")
|
svgName: "user-power-" + (admin ? "100" : "50")
|
||||||
|
|
|
@ -12,6 +12,7 @@ HTileDelegate {
|
||||||
displayName: model.display_name
|
displayName: model.display_name
|
||||||
mxc: model.avatar_url
|
mxc: model.avatar_url
|
||||||
powerLevel: model.power_level
|
powerLevel: model.power_level
|
||||||
|
shiftPowerIconPosition: ! roomSidePane.collapsed
|
||||||
}
|
}
|
||||||
|
|
||||||
title.text: model.display_name || model.user_id
|
title.text: model.display_name || model.user_id
|
||||||
|
|
Loading…
Reference in New Issue
Block a user