diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-10-26 14:57:54 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-10-26 21:34:34 +0100 |
commit | 3d64df41dac45693d1e2626909f0e55d4b7a6f47 (patch) | |
tree | d592ee2279235b9d7dc58f52c3cfed06ea61d707 /resources/qml/ReplyPopup.qml | |
parent | Qml message input mockup (diff) | |
download | nheko-3d64df41dac45693d1e2626909f0e55d4b7a6f47.tar.xz |
Split up TimelineView into separate components
Diffstat (limited to 'resources/qml/ReplyPopup.qml')
-rw-r--r-- | resources/qml/ReplyPopup.qml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/resources/qml/ReplyPopup.qml b/resources/qml/ReplyPopup.qml new file mode 100644 index 00000000..4659e075 --- /dev/null +++ b/resources/qml/ReplyPopup.qml @@ -0,0 +1,47 @@ +import "./delegates/" +import QtQuick 2.9 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import im.nheko 1.0 + +Rectangle { + id: replyPopup + + property var room: TimelineManager.timeline + + Layout.fillWidth: true + visible: room && room.reply + // Height of child, plus margins, plus border + implicitHeight: replyPreview.height + 10 + color: colors.window + z: 3 + + Reply { + id: replyPreview + + anchors.left: parent.left + anchors.leftMargin: 2 * 22 + 3 * 16 + anchors.right: closeReplyButton.left + anchors.rightMargin: 2 * 22 + 3 * 16 + anchors.bottom: parent.bottom + modelData: room ? room.getDump(room.reply, room.id) : { + } + userColor: TimelineManager.userColor(modelData.userId, colors.window) + } + + ImageButton { + id: closeReplyButton + + anchors.right: parent.right + anchors.rightMargin: 15 + anchors.top: replyPreview.top + hoverEnabled: true + width: 16 + height: 16 + image: ":/icons/icons/ui/remove-symbol.png" + ToolTip.visible: closeReplyButton.hovered + ToolTip.text: qsTr("Close") + onClicked: room.reply = undefined + } + +} |