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 <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-06-15 19:08:16 +02:00 committed by Camila
parent f147e5a66f
commit 4f7a6cfb1d

View File

@ -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")