diff options
Diffstat (limited to 'kodereviewer/qml/CommentPage.qml')
-rw-r--r-- | kodereviewer/qml/CommentPage.qml | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/kodereviewer/qml/CommentPage.qml b/kodereviewer/qml/CommentPage.qml index 756f5da..c63aac5 100644 --- a/kodereviewer/qml/CommentPage.qml +++ b/kodereviewer/qml/CommentPage.qml @@ -23,6 +23,10 @@ Kirigami.ScrollablePage { actions: commonActions + property string comment: "" + + onPullRequestChanged: comment = "" + Timer { // Ten minutes? id: getCommentsTimer @@ -36,6 +40,17 @@ Kirigami.ScrollablePage { } } + // Delay getCommentsTimer for 2s + Timer { + id: delayTimer + interval: 1000 * 2 + running: false + repeat: false + onTriggered: { + getCommentsTimer.restart() + } + } + Loader { id: commentModelLoader active: !!root.pullRequest @@ -54,13 +69,26 @@ Kirigami.ScrollablePage { Layout.fillHeight: true visible: !!root.pullRequest model: commentModelLoader.item - delegate: CommentDelegate {} + + signal quote(string a) + + delegate: CommentDelegate { + onQuote: (quote) => { + if (root.comment.length > 0) + root.comment += "\n\n" + root.comment += quote + } + } + + footerPositioning: ListView.InlineFooter + footer: Item { id: rootFooter anchors.left: parent.left anchors.right: parent.right height: footerLayout.implicitHeight + RowLayout { id: footerLayout anchors.fill: parent @@ -69,6 +97,7 @@ Kirigami.ScrollablePage { MarkdownTextArea { id: newCommentTextArea Layout.fillWidth: true + text: root.comment } QQC2.Button { icon.name: "document-send-symbolic" @@ -81,12 +110,11 @@ Kirigami.ScrollablePage { } root.connection.createComment(root.pullRequest.number, newCommentTextArea.text) - newCommentTextArea.text == '' - getCommentsTimer.restart() + root.comment = '' + delayTimer.restart() } } } - } } } |