summaryrefslogtreecommitdiffstats
path: root/resources/qml/ReplyPopup.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-06-02 01:45:24 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-06-08 22:32:08 +0200
commit5aee8d609a3fcca63bb9a0f983a77b45eebfefe7 (patch)
tree1f270d525e4e5b5db381d19675467620593368cd /resources/qml/ReplyPopup.qml
parentde8522a185f9d62eaefb37d0f1a5e2e77c73c175 (diff)
Format qml
Diffstat (limited to 'resources/qml/ReplyPopup.qml')
-rw-r--r--resources/qml/ReplyPopup.qml64
1 files changed, 31 insertions, 33 deletions
diff --git a/resources/qml/ReplyPopup.qml b/resources/qml/ReplyPopup.qml
index 6fceb4e5..ce24297c 100644
--- a/resources/qml/ReplyPopup.qml
+++ b/resources/qml/ReplyPopup.qml
@@ -12,91 +12,89 @@ Rectangle {
id: replyPopup
Layout.fillWidth: true
- visible: room && (room.reply || room.edit || room.thread)
+ color: palette.window
// Height of child, plus margins, plus border
implicitHeight: (room && room.reply ? replyPreview.height : Math.max(closeEditButton.height, closeThreadButton.height)) + Nheko.paddingSmall
- color: palette.window
+ visible: room && (room.reply || room.edit || room.thread)
z: 3
Reply {
id: replyPreview
- property var modelData: room ? room.getDump(room.reply, room.id) : {
- }
+ property var modelData: room ? room.getDump(room.reply, room.id) : {}
- visible: room && room.reply
anchors.left: parent.left
- anchors.leftMargin: replyPopup.width < 450? Nheko.paddingSmall : (CallManager.callsSupported? 2*(22+16) : 1*(22+16))
+ 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.rightMargin: replyPopup.width < 450 ? 2 * (22 + 16) : 3 * (22 + 16)
anchors.top: parent.top
anchors.topMargin: Nheko.paddingSmall
- userColor: TimelineManager.userColor(modelData.userId, palette.window)
blurhash: modelData.blurhash ?? ""
body: modelData.body ?? ""
- formattedBody: modelData.formattedBody ?? ""
+ encryptionError: modelData.encryptionError ?? 0
eventId: modelData.eventId ?? ""
filename: modelData.filename ?? ""
filesize: modelData.filesize ?? ""
+ formattedBody: modelData.formattedBody ?? ""
+ isOnlyEmoji: modelData.isOnlyEmoji ?? false
+ originalWidth: modelData.originalWidth ?? 0
proportionalHeight: modelData.proportionalHeight ?? 1
type: modelData.type ?? MtxEvent.UnknownMessage
typeString: modelData.typeString ?? ""
url: modelData.url ?? ""
- originalWidth: modelData.originalWidth ?? 0
- isOnlyEmoji: modelData.isOnlyEmoji ?? false
+ userColor: TimelineManager.userColor(modelData.userId, palette.window)
userId: modelData.userId ?? ""
userName: modelData.userName ?? ""
- encryptionError: modelData.encryptionError ?? 0
+ visible: room && room.reply
width: parent.width
}
-
ImageButton {
id: closeReplyButton
- visible: room && room.reply
+ ToolTip.text: qsTr("Close")
+ ToolTip.visible: closeReplyButton.hovered
+ anchors.margins: Nheko.paddingSmall
anchors.right: replyPreview.right
anchors.top: replyPreview.top
- anchors.margins: Nheko.paddingSmall
- hoverEnabled: true
- width: 16
height: 16
+ hoverEnabled: true
image: ":/icons/icons/ui/dismiss.svg"
- ToolTip.visible: closeReplyButton.hovered
- ToolTip.text: qsTr("Close")
+ visible: room && room.reply
+ width: 16
+
onClicked: room.reply = undefined
}
-
ImageButton {
id: closeEditButton
- visible: room && room.edit
- anchors.right: closeThreadButton.left
+ ToolTip.text: qsTr("Cancel Edit")
+ ToolTip.visible: closeEditButton.hovered
anchors.margins: 8
+ anchors.right: closeThreadButton.left
anchors.top: parent.top
+ height: 22
hoverEnabled: true
image: ":/icons/icons/ui/dismiss_edit.svg"
+ visible: room && room.edit
width: 22
- height: 22
- ToolTip.visible: closeEditButton.hovered
- ToolTip.text: qsTr("Cancel Edit")
+
onClicked: room.edit = undefined
}
-
ImageButton {
id: closeThreadButton
- visible: room && room.thread
- anchors.right: parent.right
+ ToolTip.text: qsTr("Cancel Thread")
+ ToolTip.visible: closeThreadButton.hovered
anchors.margins: 8
+ anchors.right: parent.right
anchors.top: parent.top
- hoverEnabled: true
buttonTextColor: room ? TimelineManager.userColor(room.thread, palette.base) : palette.buttonText
+ height: 22
+ hoverEnabled: true
image: ":/icons/icons/ui/dismiss_thread.svg"
+ visible: room && room.thread
width: 22
- height: 22
- ToolTip.visible: closeThreadButton.hovered
- ToolTip.text: qsTr("Cancel Thread")
+
onClicked: room.thread = undefined
}
-
}