mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cfe8641fd8 |
@@ -1,33 +1,30 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import Qt.labs.platform
|
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
property var textObj
|
property var textObj
|
||||||
|
|
||||||
|
popupType: Popup.Native
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("C&ut")
|
text: qsTr("C&ut")
|
||||||
shortcut: StandardKey.Cut
|
|
||||||
enabled: textObj.selectedText
|
enabled: textObj.selectedText
|
||||||
onTriggered: textObj.cut()
|
onTriggered: textObj.cut()
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("&Copy")
|
text: qsTr("&Copy")
|
||||||
shortcut: StandardKey.Copy
|
|
||||||
enabled: textObj.selectedText
|
enabled: textObj.selectedText
|
||||||
onTriggered: textObj.copy()
|
onTriggered: textObj.copy()
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("&Paste")
|
text: qsTr("&Paste")
|
||||||
shortcut: StandardKey.Paste
|
// Fix calling paste from clipboard when launching app on android
|
||||||
// Fix calling paste from clipboard when launching app on android/ios
|
enabled: Qt.platform.os === "android" ? true : textObj.canPaste
|
||||||
enabled: (Qt.platform.os === "android" || Qt.platform.os === "ios") ? true : textObj.canPaste
|
|
||||||
onTriggered: textObj.paste()
|
onTriggered: textObj.paste()
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("&SelectAll")
|
text: qsTr("&SelectAll")
|
||||||
shortcut: StandardKey.SelectAll
|
|
||||||
enabled: textObj.length > 0
|
enabled: textObj.length > 0
|
||||||
onTriggered: textObj.selectAll()
|
onTriggered: textObj.selectAll()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,25 +93,13 @@ Rectangle {
|
|||||||
|
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
|
|
||||||
MouseArea {
|
ContextMenu.menu: ContextMenuType {
|
||||||
id: textAreaMouse
|
textObj: textArea
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.RightButton
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: {
|
|
||||||
fl.interactive = true
|
|
||||||
contextMenu.open()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
root.border.color = getBorderColor(borderNormalColor)
|
root.border.color = getBorderColor(borderNormalColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
ContextMenuType {
|
|
||||||
id: contextMenu
|
|
||||||
textObj: textArea
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,25 +79,13 @@ Rectangle {
|
|||||||
|
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
|
|
||||||
MouseArea {
|
ContextMenu.menu: ContextMenuType {
|
||||||
id: textAreaMouse
|
textObj: textArea
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.RightButton
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: {
|
|
||||||
fl.interactive = true
|
|
||||||
contextMenu.open()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
root.border.color = getBorderColor(borderNormalColor)
|
root.border.color = getBorderColor(borderNormalColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
ContextMenuType {
|
|
||||||
id: contextMenu
|
|
||||||
textObj: textArea
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
@@ -137,15 +137,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
ContextMenu.menu: ContextMenuType {
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.RightButton
|
|
||||||
onClicked: contextMenu.open()
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
|
|
||||||
ContextMenuType {
|
|
||||||
id: contextMenu
|
|
||||||
textObj: textField
|
textObj: textField
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user