fix: app buttons clicked instead of buttons in context menu (#2200)

* fix: app buttons clicked instead of buttons in context menu

* update: using MouseArea instead of changing popupType

* fix(cursor): fixed cursor type at opened context menu

---------

Co-authored-by: Mitternacht822 <sb@amnezia.org>
This commit is contained in:
MrMirDan
2026-05-15 16:02:09 +03:00
committed by GitHub
parent c9ed0baf3b
commit c7b1c2809f
4 changed files with 16 additions and 3 deletions

View File

@@ -6,6 +6,9 @@ Menu {
popupType: Popup.Native
onAboutToShow: blocker.enabled = true
onClosed: blocker.enabled = false
MenuItem {
text: qsTr("C&ut")
enabled: textObj.selectedText
@@ -28,4 +31,11 @@ Menu {
enabled: textObj.length > 0
onTriggered: textObj.selectAll()
}
MouseArea {
id: blocker
z: 2
enabled: false
preventStealing: true
}
}

View File

@@ -24,7 +24,7 @@ Rectangle {
MouseArea {
id: parentMouse
anchors.fill: parent
cursorShape: Qt.IBeamCursor
cursorShape: contextMenu.opened ? Qt.ArrowCursor : Qt.IBeamCursor
onClicked: textArea.forceActiveFocus()
hoverEnabled: true
@@ -94,6 +94,7 @@ Rectangle {
wrapMode: Text.Wrap
ContextMenu.menu: ContextMenuType {
id: contextMenu
textObj: textArea
}

View File

@@ -34,7 +34,7 @@ Rectangle {
MouseArea {
id: parentMouse
anchors.fill: parent
cursorShape: Qt.IBeamCursor
cursorShape: contextMenu.opened ? Qt.ArrowCursor : Qt.IBeamCursor
onClicked: textArea.forceActiveFocus()
hoverEnabled: true
@@ -80,6 +80,7 @@ Rectangle {
wrapMode: Text.Wrap
ContextMenu.menu: ContextMenuType {
id: contextMenu
textObj: textArea
}

View File

@@ -135,6 +135,7 @@ Item {
}
ContextMenu.menu: ContextMenuType {
id: contextMenu
textObj: textField
}
@@ -159,7 +160,7 @@ Item {
MouseArea {
anchors.fill: root
cursorShape: Qt.IBeamCursor
cursorShape: contextMenu.opened ? Qt.ArrowCursor : Qt.IBeamCursor
hoverEnabled: true