Make activity items with a link clickable
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 15 Jun 2020 17:08:16 +0000 (19:08 +0200)
committerCamila <smayres@gmail.com>
Tue, 16 Jun 2020 16:52:20 +0000 (18:52 +0200)
We then get more items clickable, in particular the bottom one proposing
to open the activity application. Now we can click it and it opens the
activity application straight away.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/tray/Window.qml

index ddbd5594af10883ba22ed0d6c53b14dffc48c472..95ee10b6e625042e0006f4523531c288e20e01e3 100644 (file)
@@ -444,16 +444,22 @@ Window {
                 spacing: 0\r
 \r
                 MouseArea {\r
-                    enabled: (path !== "")\r
+                    enabled: (path !== "" || link !== "")\r
                     anchors.left: activityItem.left\r
                     anchors.right: ((shareButton.visible) ? shareButton.left : activityItem.right)\r
                     height: parent.height\r
                     anchors.margins: 2\r
                     hoverEnabled: true\r
-                    onClicked: Qt.openUrlExternally(path)\r
+                    onClicked: {\r
+                        if (path !== "") {\r
+                            Qt.openUrlExternally(path)\r
+                        } else {\r
+                            Qt.openUrlExternally(link)\r
+                        }\r
+                    }\r
                     ToolTip.visible: hovered\r
                     ToolTip.delay: 1000\r
-                    ToolTip.text: qsTr("Open sync item locally")\r
+                    ToolTip.text: path !== "" ? qsTr("Open sync item locally") : qsTr("Open URL")\r
                     Rectangle {\r
                         anchors.fill: parent\r
                         color: (parent.containsMouse ? Style.lightHover : "transparent")\r