From a76b50b48e790625d1089f38483f18ffa62b935b Mon Sep 17 00:00:00 2001 From: Malte E Date: Fri, 11 Mar 2022 21:32:32 +0100 Subject: [PATCH] small rework of the reply popup --- resources/icons/ui/dismiss_edit.svg | 15 +++++++++++++++ resources/qml/MessageInput.qml | 1 - resources/qml/ReplyPopup.qml | 30 ++++++++++++++++------------- resources/res.qrc | 1 + 4 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 resources/icons/ui/dismiss_edit.svg diff --git a/resources/icons/ui/dismiss_edit.svg b/resources/icons/ui/dismiss_edit.svg new file mode 100644 index 00000000..c78a55c7 --- /dev/null +++ b/resources/icons/ui/dismiss_edit.svg @@ -0,0 +1,15 @@ + + + + diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index f8ab494b..9a21ac05 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -446,7 +446,6 @@ Rectangle { width: 22 height: 22 image: ":/icons/icons/ui/send.svg" - Layout.rightMargin: 8 ToolTip.visible: hovered ToolTip.text: qsTr("Send") onClicked: { diff --git a/resources/qml/ReplyPopup.qml b/resources/qml/ReplyPopup.qml index ef0d7c60..914f5d33 100644 --- a/resources/qml/ReplyPopup.qml +++ b/resources/qml/ReplyPopup.qml @@ -15,7 +15,7 @@ Rectangle { Layout.fillWidth: true visible: room && (room.reply || room.edit) // Height of child, plus margins, plus border - implicitHeight: (room && room.reply ? replyPreview.height : closeEditButton.height) + 10 + implicitHeight: (room && room.reply ? replyPreview.height : closeEditButton.height) + Nheko.paddingSmall color: Nheko.colors.window z: 3 @@ -27,10 +27,11 @@ Rectangle { visible: room && room.reply anchors.left: parent.left - anchors.leftMargin: 2 * 22 + 3 * 16 - anchors.right: closeReplyButton.left - anchors.rightMargin: 2 * 22 + 3 * 16 - anchors.bottom: parent.bottom + anchors.leftMargin: replyPopup.width < 450? Nheko.paddingSmall : (CallManager.callsSupported? 2*(22+16) : 1*(22+16)) + anchors.right: parent.right + anchors.rightMargin: replyPopup.width < 450? 2*(22+16) : 3*(22+16) + anchors.top: parent.top + anchors.topMargin: Nheko.paddingSmall userColor: TimelineManager.userColor(modelData.userId, Nheko.colors.window) blurhash: modelData.blurhash ?? "" body: modelData.body ?? "" @@ -54,9 +55,9 @@ Rectangle { id: closeReplyButton visible: room && room.reply - anchors.right: parent.right - anchors.rightMargin: 16 + anchors.right: replyPreview.right anchors.top: replyPreview.top + anchors.margins: Nheko.paddingSmall hoverEnabled: true width: 16 height: 16 @@ -66,16 +67,19 @@ Rectangle { onClicked: room.reply = undefined } - Button { + ImageButton { id: closeEditButton visible: room && room.edit - anchors.left: parent.left - anchors.rightMargin: 16 - anchors.topMargin: 10 + anchors.right: parent.right + anchors.margins: 8 anchors.top: parent.top - //height: 16 - text: qsTr("Cancel edit") + hoverEnabled: true + image: ":/icons/icons/ui/dismiss_edit.svg" + width: 22 + height: 22 + ToolTip.visible: closeEditButton.hovered + ToolTip.text: qsTr("Cancel Edit") onClicked: room.edit = undefined } diff --git a/resources/res.qrc b/resources/res.qrc index c8659150..a383f805 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -10,6 +10,7 @@ icons/ui/collapsed.svg icons/ui/delete.svg icons/ui/dismiss.svg + icons/ui/dismiss_edit.svg icons/ui/double-checkmark.svg icons/ui/download.svg icons/ui/edit.svg