Changeset View
Changeset View
Standalone View
Standalone View
src/controls/UrlButton.qml
Show All 39 Lines | 34 | { | |||
---|---|---|---|---|---|
40 | 40 | | |||
41 | onPressed: if (mouse.button === Qt.RightButton) { | 41 | onPressed: if (mouse.button === Qt.RightButton) { | ||
42 | menu.popup() | 42 | menu.popup() | ||
43 | } | 43 | } | ||
44 | onClicked: if (mouse.button !== Qt.RightButton) { | 44 | onClicked: if (mouse.button !== Qt.RightButton) { | ||
45 | Qt.openUrlExternally(url) | 45 | Qt.openUrlExternally(url) | ||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | QQC2.ToolTip { | ||||
49 | // If button's text has been overridden, show a tooltip to expose the raw URL | ||||
50 | visible: button.text != button.url && button.mouseArea.containsMouse | ||||
51 | text: url | ||||
52 | } | ||||
53 | | ||||
48 | QQC2.Menu { | 54 | QQC2.Menu { | ||
49 | id: menu | 55 | id: menu | ||
50 | QQC2.MenuItem { | 56 | QQC2.MenuItem { | ||
51 | text: qsTr("Copy link address") | 57 | text: qsTr("Copy link address") | ||
52 | onClicked: KirigamiPrivate.CopyHelperPrivate.copyTextToClipboard(button.url) | 58 | onClicked: KirigamiPrivate.CopyHelperPrivate.copyTextToClipboard(button.url) | ||
53 | } | 59 | } | ||
54 | } | 60 | } | ||
55 | } | 61 | } |