Work around the duplicate right click menus on KDE
This commit is contained in:
parent
eaf9ae315c
commit
f25a1b5c36
@ -317,6 +317,23 @@ TimelineEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Item {
|
||||||
|
// We need this item to grab events, that otherwise would go to the TextArea in the main item. If we don't have this, it would trigger a right click menu on KDE...
|
||||||
|
// https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/9d71fe874186009f76d392e203d9fa25a49f8be7/org.kde.desktop/TextArea.qml#L55
|
||||||
|
|
||||||
|
anchors.fill: gridContainer
|
||||||
|
anchors.topMargin: replyRow.height
|
||||||
|
TapHandler {
|
||||||
|
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
|
||||||
|
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||||
|
|
||||||
|
onSingleTapped: (event) => {
|
||||||
|
messageContextMenu.show(wrapper.eventId, wrapper.threadId, wrapper.type, wrapper.isSender, wrapper.isEncrypted, wrapper.isEditable, wrapper.main.hoveredLink, wrapper.main.copyText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
Reactions {
|
Reactions {
|
||||||
id: reactionRow
|
id: reactionRow
|
||||||
|
|
||||||
|
@ -75,16 +75,20 @@ TimelineEvent {
|
|||||||
z: 4
|
z: 4
|
||||||
},
|
},
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
// this looks better without margins
|
||||||
anchors.fill: gridContainer
|
anchors.fill: gridContainer
|
||||||
color: (Settings.messageHoverHighlight && messageHover.hovered) ? palette.alternateBase : "transparent"
|
color: (Settings.messageHoverHighlight && messageHover.hovered) ? palette.alternateBase : "transparent"
|
||||||
|
|
||||||
// this looks better without margins
|
// This is partially duplicated by a later handler, however we need this to handle the remaining events around the reply.
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
|
||||||
gesturePolicy: TapHandler.ReleaseWithinBounds
|
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||||
|
|
||||||
onSingleTapped: messageContextMenu.show(wrapper.eventId, wrapper.threadId, wrapper.type, wrapper.isSender, wrapper.isEncrypted, wrapper.isEditable, wrapper.main.hoveredLink, wrapper.main.copyText)
|
onSingleTapped: (event) => {
|
||||||
|
messageContextMenu.show(wrapper.eventId, wrapper.threadId, wrapper.type, wrapper.isSender, wrapper.isEncrypted, wrapper.isEditable, wrapper.main.hoveredLink, wrapper.main.copyText);
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@ -312,6 +316,23 @@ TimelineEvent {
|
|||||||
timestamp: wrapper.timestamp
|
timestamp: wrapper.timestamp
|
||||||
room: wrapper.room
|
room: wrapper.room
|
||||||
},
|
},
|
||||||
|
Item {
|
||||||
|
// We need this item to grab events, that otherwise would go to the TextArea in the main item. If we don't have this, it would trigger a right click menu on KDE...
|
||||||
|
// https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/9d71fe874186009f76d392e203d9fa25a49f8be7/org.kde.desktop/TextArea.qml#L55
|
||||||
|
|
||||||
|
anchors.fill: gridContainer
|
||||||
|
anchors.topMargin: replyRow.height
|
||||||
|
TapHandler {
|
||||||
|
|
||||||
|
acceptedButtons: Qt.RightButton
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
|
||||||
|
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||||
|
|
||||||
|
onSingleTapped: (event) => {
|
||||||
|
messageContextMenu.show(wrapper.eventId, wrapper.threadId, wrapper.type, wrapper.isSender, wrapper.isEncrypted, wrapper.isEditable, wrapper.main.hoveredLink, wrapper.main.copyText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
Reactions {
|
Reactions {
|
||||||
id: reactionRow
|
id: reactionRow
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user