From 4f7a6cfb1d19dc2fc66aa87b307cb397a79020f3 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 15 Jun 2020 19:08:16 +0200 Subject: [PATCH] Make activity items with a link clickable 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 --- src/gui/tray/Window.qml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index ddbd5594a..95ee10b6e 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -444,16 +444,22 @@ Window { spacing: 0 MouseArea { - enabled: (path !== "") + enabled: (path !== "" || link !== "") anchors.left: activityItem.left anchors.right: ((shareButton.visible) ? shareButton.left : activityItem.right) height: parent.height anchors.margins: 2 hoverEnabled: true - onClicked: Qt.openUrlExternally(path) + onClicked: { + if (path !== "") { + Qt.openUrlExternally(path) + } else { + Qt.openUrlExternally(link) + } + } ToolTip.visible: hovered ToolTip.delay: 1000 - ToolTip.text: qsTr("Open sync item locally") + ToolTip.text: path !== "" ? qsTr("Open sync item locally") : qsTr("Open URL") Rectangle { anchors.fill: parent color: (parent.containsMouse ? Style.lightHover : "transparent") -- 2.30.2