mirror of
https://github.com/amnezia-vpn/DefaultVPN.git
synced 2026-05-17 08:36:37 +03:00
fix: fixed context menu (#29)
This commit is contained in:
@@ -239,6 +239,7 @@
|
||||
<file>ui/qml/Pages2/PageSettingsApiDevices.qml</file>
|
||||
<file>images/controls/monitor.svg</file>
|
||||
<file>ui/qml/DefaultVpn/Controls/DropDownType.qml</file>
|
||||
<file>ui/qml/DefaultVpn/Controls/ContextMenuType.qml</file>
|
||||
<file>ui/qml/DefaultVpn/main.qml</file>
|
||||
<file>ui/qml/DefaultVpn/Pages/PageHome.qml</file>
|
||||
<file>ui/qml/DefaultVpn/Pages/PageSettings.qml</file>
|
||||
|
||||
31
client/ui/qml/DefaultVpn/Controls/ContextMenuType.qml
Normal file
31
client/ui/qml/DefaultVpn/Controls/ContextMenuType.qml
Normal file
@@ -0,0 +1,31 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Menu {
|
||||
property var textObj
|
||||
|
||||
popupType: Popup.Native
|
||||
|
||||
MenuItem {
|
||||
text: qsTr("C&ut")
|
||||
enabled: textObj.selectedText
|
||||
onTriggered: textObj.cut()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("&Copy")
|
||||
enabled: textObj.selectedText
|
||||
onTriggered: textObj.copy()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("&Paste")
|
||||
// Fix calling paste from clipboard when launching app on android
|
||||
enabled: Qt.platform.os === "android" ? true : textObj.canPaste
|
||||
onTriggered: textObj.paste()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: qsTr("&SelectAll")
|
||||
enabled: textObj.length > 0
|
||||
onTriggered: textObj.selectAll()
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,10 @@ TextField {
|
||||
radius: 6
|
||||
}
|
||||
|
||||
ContextMenu.menu: ContextMenuType {
|
||||
textObj: root
|
||||
}
|
||||
|
||||
topPadding: 12
|
||||
bottomPadding: 12
|
||||
leftPadding: 16
|
||||
|
||||
Reference in New Issue
Block a user