aboutsummaryrefslogtreecommitdiff
path: root/kodereviewer/qml/CommentDelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/qml/CommentDelegate.qml')
-rw-r--r--kodereviewer/qml/CommentDelegate.qml14
1 files changed, 13 insertions, 1 deletions
diff --git a/kodereviewer/qml/CommentDelegate.qml b/kodereviewer/qml/CommentDelegate.qml
index 3b2681b..536fada 100644
--- a/kodereviewer/qml/CommentDelegate.qml
+++ b/kodereviewer/qml/CommentDelegate.qml
@@ -13,6 +13,8 @@ Kirigami.AbstractCard {
required property string username
required property string body
+ signal quote(string body);
+
header: RowLayout {
KirigamiComponents.Avatar {
name: root.username
@@ -34,7 +36,13 @@ Kirigami.AbstractCard {
actions: [
Kirigami.Action {
icon.name: "overflow-menu"
-
+ Kirigami.Action {
+ text: i18n("Quote")
+ icon.name: "format-text-blockquote-symbolic"
+ onTriggered: {
+ root.quote(root.quoteText())
+ }
+ }
Kirigami.Action {
text: "Edit"
icon.name: "edit-comment"
@@ -72,4 +80,8 @@ Kirigami.AbstractCard {
}
}
}
+
+ function quoteText() {
+ return root.body.split("\n").map((line) => "> " + line).join("\n")
+ }
}