mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-10-23 03:26:59 +09:00
* refactor: focus controller refactoring * feat: update to new design system * feat: update to new desing system * chore: bump version
62 lines
1.4 KiB
QML
62 lines
1.4 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
import Style 1.0
|
|
|
|
import "../Controls2"
|
|
import "../Controls2/TextTypes"
|
|
|
|
import "../Config"
|
|
|
|
SheetType {
|
|
property string serverNameText
|
|
|
|
id: root
|
|
objectName: "serverNameEditDrawer"
|
|
|
|
expandedHeight: content.implicitHeight + 16 + 8 + PageController.safeAreaBottomMargin + PageController.imeHeight
|
|
|
|
ColumnLayout {
|
|
id: content
|
|
|
|
anchors.top: parent.top
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.topMargin: 16
|
|
anchors.leftMargin: 16
|
|
anchors.rightMargin: 16
|
|
|
|
spacing: 26
|
|
|
|
TextFieldType {
|
|
id: serverName
|
|
|
|
Layout.fillWidth: true
|
|
headerText: qsTr("Server name")
|
|
textField.text: root.serverNameText
|
|
textField.maximumLength: 30
|
|
checkEmptyText: true
|
|
}
|
|
|
|
ButtonType {
|
|
id: saveButton
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: qsTr("Save")
|
|
|
|
onClicked: {
|
|
if (serverName.textField.text === "") {
|
|
return
|
|
}
|
|
|
|
if (serverName.textField.text !== root.serverNameText) {
|
|
ServersUiController.editServerName(ServersUiController.processedServerId, serverName.textField.text);
|
|
}
|
|
root.close()
|
|
}
|
|
}
|
|
}
|
|
}
|