Skip to content
Snippets Groups Projects
Verified Commit 9ab1dc25 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Copy address location

fixes #463
parent 6d464381
No related branches found
No related tags found
No related merge requests found
Pipeline #1076 passed
......@@ -117,7 +117,7 @@ ScrollView {
image: ":/icons/icons/ui/vertical-ellipsis.png"
ToolTip.visible: hovered
ToolTip.text: qsTr("Options")
onClicked: messageContextMenu.show(row.model.id, row.model.type, row.model.isEncrypted, row.model.isEditable, optionsButton)
onClicked: messageContextMenu.show(row.model.id, row.model.type, row.model.isEncrypted, row.model.isEditable, "", optionsButton)
}
}
......
......@@ -28,12 +28,12 @@ Item {
TapHandler {
acceptedButtons: Qt.RightButton
onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable)
onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, contentItem.child.hoveredLink)
gesturePolicy: TapHandler.ReleaseWithinBounds
}
TapHandler {
onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable)
onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, contentItem.child.hoveredLink)
onDoubleTapped: chat.model.reply = model.id
gesturePolicy: TapHandler.ReleaseWithinBounds
}
......
......@@ -92,21 +92,33 @@ Page {
id: messageContextMenu
property string eventId
property string link
property int eventType
property bool isEncrypted
property bool isEditable
function show(eventId_, eventType_, isEncrypted_, isEditable_, showAt_) {
function show(eventId_, eventType_, isEncrypted_, isEditable_, link_, showAt_) {
eventId = eventId_;
eventType = eventType_;
isEncrypted = isEncrypted_;
isEditable = isEditable_;
if (link_)
link = link_;
else
link = "";
if (showAt_)
open(showAt_);
else
open();
}
Platform.MenuItem {
visible: messageContextMenu.link
enabled: visible
text: qsTr("Copy address location")
onTriggered: Clipboard.text = messageContextMenu.link
}
Platform.MenuItem {
id: reactionOption
......@@ -177,7 +189,7 @@ Page {
enabled: visible
text: qsTr("Open in external program")
onTriggered: TimelineManager.timeline.openMedia(messageContextMenu.eventId)
}
}
Platform.MenuItem {
visible: messageContextMenu.eventId
......
......@@ -8,6 +8,7 @@ import im.nheko 1.0
Item {
property alias modelData: model.data
property alias isReply: model.isReply
property alias child: chooser.child
property real implicitWidth: (chooser.child && chooser.child.implicitWidth) ? chooser.child.implicitWidth : width
height: chooser.childrenRect.height
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment