summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-09-01 14:17:33 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:14 +0100
commit2dd636456c22a85751e3484776c45efc9458b9ba (patch)
treed0eeb906b6d1a8f7fa5089a768f8fbe9fdcc5c5e /resources
parentImplement loading of history, when timeline is displayed (diff)
downloadnheko-2dd636456c22a85751e3484776c45efc9458b9ba.tar.xz
Add basic sections and button placeholders to qml timeline
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/TimelineView.qml90
1 files changed, 86 insertions, 4 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml

index 3d4c1147..7ff51362 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml
@@ -1,4 +1,6 @@ -import QtQuick 2.1 +import QtQuick 2.5 +import QtQuick.Controls 2.5 +import QtQuick.Layouts 1.5 Rectangle { anchors.fill: parent @@ -17,9 +19,89 @@ Rectangle { id: chat model: timelineManager.timeline - delegate: Text { - height: contentHeight - text: model.userId + delegate: RowLayout { + width: chat.width + Text { + Layout.fillWidth: true + height: contentHeight + text: model.userName + } + + Button { + Layout.alignment: Qt.AlignRight + id: replyButton + flat: true + height: replyButtonImg.contentHeight + width: replyButtonImg.contentWidth + ToolTip.visible: hovered + ToolTip.text: qsTr("Reply") + Image { + id: replyButtonImg + // Workaround, can't get icon.source working for now... + anchors.fill: parent + source: "qrc:/icons/icons/ui/mail-reply.png" + } + } + Button { + Layout.alignment: Qt.AlignRight + id: optionsButton + flat: true + height: optionsButtonImg.contentHeight + width: optionsButtonImg.contentWidth + ToolTip.visible: hovered + ToolTip.text: qsTr("Options") + Image { + id: optionsButtonImg + // Workaround, can't get icon.source working for now... + anchors.fill: parent + source: "qrc:/icons/icons/ui/vertical-ellipsis.png" + } + + onClicked: contextMenu.open() + + Menu { + y: optionsButton.height + id: contextMenu + + MenuItem { + text: "Read receipts" + } + MenuItem { + text: "Mark as read" + } + MenuItem { + text: "View raw message" + } + MenuItem { + text: "Redact message" + } + } + } + + Text { + Layout.alignment: Qt.AlignRight + text: model.timestamp.toLocaleTimeString("HH:mm") + } + } + + section { + property: "section" + delegate: Column { + width: parent.width + Label { + anchors.horizontalCenter: parent.horizontalCenter + visible: section.includes(" ") + text: Qt.formatDate(new Date(Number(section.split(" ")[1]))) + height: contentHeight * 1.2 + width: contentWidth * 1.2 + horizontalAlignment: Text.AlignHCenter + background: Rectangle { + radius: parent.height / 2 + color: "black" + } + } + Text { text: section.split(" ")[0] } + } } } }