mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
fix: Replace context menu to system specific
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt.labs.platform as Platform
|
||||
import ChatView
|
||||
import UIControls
|
||||
|
||||
@@ -52,7 +53,7 @@ Flow {
|
||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
||||
onClicked: (mouse) => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
contextMenu.popup()
|
||||
contextMenu.open()
|
||||
} else if (mouse.button === Qt.MiddleButton ||
|
||||
(mouse.button === Qt.LeftButton && (mouse.modifiers & Qt.ControlModifier))) {
|
||||
root.removeFileFromListByIndex(fileItem.index)
|
||||
@@ -70,23 +71,23 @@ Flow {
|
||||
}
|
||||
}
|
||||
|
||||
Menu {
|
||||
Platform.Menu {
|
||||
id: contextMenu
|
||||
|
||||
MenuItem {
|
||||
text: "Open in Qt Creator"
|
||||
Platform.MenuItem {
|
||||
text: qsTr("Open in Qt Creator")
|
||||
onTriggered: fileItem.openFileInEditor()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: "Open in External Editor"
|
||||
Platform.MenuItem {
|
||||
text: qsTr("Open in External Editor")
|
||||
onTriggered: fileItem.openFileInExternalEditor()
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Platform.MenuSeparator {}
|
||||
|
||||
MenuItem {
|
||||
text: "Remove"
|
||||
Platform.MenuItem {
|
||||
text: qsTr("Remove")
|
||||
onTriggered: root.removeFileFromListByIndex(fileItem.index)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user