mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
fix: fixed context menu crush on ios
This commit is contained in:
@@ -6,8 +6,36 @@ Menu {
|
|||||||
|
|
||||||
popupType: Popup.Native
|
popupType: Popup.Native
|
||||||
|
|
||||||
onAboutToShow: blocker.enabled = true
|
property Item inputBlocker: null
|
||||||
onClosed: blocker.enabled = false
|
|
||||||
|
Component {
|
||||||
|
id: inputBlockerComponent
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
preventStealing: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onAboutToShow: {
|
||||||
|
if (!textObj || !textObj.window) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const contentItem = textObj.window.contentItem
|
||||||
|
if (!inputBlocker) {
|
||||||
|
inputBlocker = inputBlockerComponent.createObject(contentItem)
|
||||||
|
} else {
|
||||||
|
inputBlocker.parent = contentItem
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClosed: {
|
||||||
|
if (inputBlocker) {
|
||||||
|
inputBlocker.destroy()
|
||||||
|
inputBlocker = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("C&ut")
|
text: qsTr("C&ut")
|
||||||
@@ -31,11 +59,4 @@ Menu {
|
|||||||
enabled: textObj.length > 0
|
enabled: textObj.length > 0
|
||||||
onTriggered: textObj.selectAll()
|
onTriggered: textObj.selectAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: blocker
|
|
||||||
z: 2
|
|
||||||
enabled: false
|
|
||||||
preventStealing: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user