From b94689c4d133d279e19e35f49ed08c438b066347 Mon Sep 17 00:00:00 2001 From: Hiers Date: Mon, 22 Aug 2022 00:01:20 +0100 Subject: [PATCH] Added discrete edit button to room profiles. --- resources/qml/dialogs/RoomSettings.qml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/resources/qml/dialogs/RoomSettings.qml b/resources/qml/dialogs/RoomSettings.qml index 6376c76b..137df6c4 100644 --- a/resources/qml/dialogs/RoomSettings.qml +++ b/resources/qml/dialogs/RoomSettings.qml @@ -49,6 +49,8 @@ ApplicationWindow { spacing: Nheko.paddingMedium Avatar { + id: displayAvatar + Layout.topMargin: Nheko.paddingMedium url: roomSettings.roomAvatarUrl.replace("mxc://", "image://MxcImage/") roomid: roomSettings.roomId @@ -56,9 +58,21 @@ ApplicationWindow { height: 130 width: 130 Layout.alignment: Qt.AlignHCenter - onClicked: { - if (roomSettings.canChangeAvatar) + onClicked: TimelineManager.openImageOverlay(null, roomSettings.roomAvatarUrl, "", 0, 0) + + ImageButton { + hoverEnabled: true + ToolTip.visible: hovered + ToolTip.text: qsTr("Change room avatar.") + anchors.left: displayAvatar.left + anchors.top: displayAvatar.top + anchors.leftMargin: Nheko.paddingMedium + anchors.topMargin: Nheko.paddingMedium + visible: roomSettings.canChangeAvatar + image: ":/icons/icons/ui/edit.svg" + onClicked: { roomSettings.updateAvatar(); + } } }