Add a clickable icon for Talk notifications.
authorCamila <hello@camila.codes>
Tue, 29 Sep 2020 17:22:43 +0000 (19:22 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Wed, 30 Sep 2020 08:46:01 +0000 (08:46 +0000)
Signed-off-by: Camila <hello@camila.codes>
src/gui/tray/Window.qml
theme.qrc
theme/reply.svg [new file with mode: 0644]

index ad4cfc0e79ec91fa8987a6c6d3cdbdcafd509164..f5d23b4a6d3e620266b430a69bbee3439054b336 100644 (file)
@@ -536,7 +536,9 @@ Window {
                     id: activityMouseArea\r
                     enabled: (path !== "" || link !== "")\r
                     anchors.left: activityItem.left\r
-                    anchors.right: ((shareButton.visible) ? shareButton.left : activityItem.right)\r
+                    anchors.right: (shareButton.visible) ? shareButton.left\r
+                                 : (replyButton.visible) ? replyButton.left\r
+                                 : activityItem.right\r
                     height: parent.height\r
                     anchors.margins: 2\r
                     hoverEnabled: true\r
@@ -645,6 +647,32 @@ Window {
                     Accessible.name: qsTr("Share") + " " + displayPath\r
                     Accessible.onPressAction: shareButton.clicked()\r
                 }\r
+\r
+                Button {\r
+                    id: replyButton\r
+                    anchors.right: activityItem.right\r
+\r
+                    Layout.preferredWidth: (objectType == "chat" || objectType == "call") ? parent.height : 0\r
+                    Layout.preferredHeight: parent.height\r
+                    Layout.alignment: Qt.AlignRight\r
+                    flat: true\r
+                    hoverEnabled: true\r
+                    visible: (objectType == "chat" || objectType == "call") ? true : false\r
+                    display: AbstractButton.IconOnly\r
+                    icon.source: "qrc:///client/theme/reply.svg"\r
+                    icon.color: "transparent"\r
+                    background: Rectangle {\r
+                        color: parent.hovered ? Style.lightHover : "transparent"\r
+                    }\r
+                    ToolTip.visible: hovered\r
+                    ToolTip.delay: 1000\r
+                    ToolTip.text: qsTr("Open Talk")\r
+                    onClicked: Qt.openUrlExternally(link)\r
+\r
+                    Accessible.role: Accessible.Button\r
+                    Accessible.name: qsTr("Open Talk") + " " + link\r
+                    Accessible.onPressAction: replyButton.clicked()\r
+                }\r
             }\r
 \r
             /*add: Transition {\r
index 6adcfdc460a45d383230cd101fcf946a455362cb..df1756d355b8aa407cad8c15a70ef6641c8eb039 100644 (file)
--- a/theme.qrc
+++ b/theme.qrc
         <file>theme/colored/Nextcloud-sidebar.svg</file>
         <file>theme/add.svg</file>
         <file>theme/share.svg</file>
+        <file>theme/reply.svg</file>
     </qresource>
 </RCC>
diff --git a/theme/reply.svg b/theme/reply.svg
new file mode 100644 (file)
index 0000000..a198103
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"><path d="M15 15s-.4-7.8-7-10V1L1 8l7 7v-4c5.1 0 7 4 7 4z"/></svg>
\ No newline at end of file