mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
parent
6d464381e4
commit
9ab1dc253e
4 changed files with 18 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue