1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-09 17:25:39 +02:00

swarmdetailspanel: only change photo if enough permissions

Change-Id: I293ff9e3fbca577c660fc2c204ed75568a176bb7
This commit is contained in:
Sébastien Blin 2022-05-12 04:35:36 -04:00
parent b0d7461e2b
commit 920bb44a3f
2 changed files with 4 additions and 2 deletions

View file

@ -32,6 +32,7 @@ Item {
property alias imageId: avatar.imageId property alias imageId: avatar.imageId
property bool newConversation: false property bool newConversation: false
property bool editable: true
property real avatarSize property real avatarSize
property real buttonSize: avatarSize property real buttonSize: avatarSize
property bool darkTheme: false property bool darkTheme: false
@ -139,7 +140,7 @@ Item {
HoverHandler { HoverHandler {
target: parent target: parent
enabled: parent.visible enabled: parent.visible && editable
onHoveredChanged: { onHoveredChanged: {
overlayHighlighted.visible = hovered overlayHighlighted.visible = hovered
} }
@ -147,7 +148,7 @@ Item {
TapHandler { TapHandler {
target: parent target: parent
enabled: parent.visible enabled: parent.visible && editable
onTapped: { onTapped: {
imageLayer.visible = false imageLayer.visible = false
buttonsRowLayout.visible = true buttonsRowLayout.visible = true

View file

@ -48,6 +48,7 @@ Rectangle {
PhotoboothView { PhotoboothView {
id: currentAccountAvatar id: currentAccountAvatar
darkTheme: UtilsAdapter.luma(root.color) darkTheme: UtilsAdapter.luma(root.color)
editable: UtilsAdapter.getParticipantRole(CurrentAccount.id, CurrentConversation.id, CurrentAccount.uri) === Member.Role.ADMIN
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter