added separation for read/write and readonly servers for pageSettingsServerProtocols, PageSettingsServerServices, PageSettingsServerData

- added fields validations for pageSetupWizardCredentials
This commit is contained in:
vladimir.kuznetsov 2023-06-23 15:24:40 +09:00
parent 249be451f7
commit 2ef53c6df9
22 changed files with 466 additions and 325 deletions

View file

@ -8,96 +8,115 @@ Item {
id: root
property string headerText
property string textFieldPlaceholderText
property bool textFieldEditable: true
property alias errorText: errorField.text
property string buttonText
property var clickedFunc
property alias textField: textField
property alias textFieldText: textField.text
property string textFieldPlaceholderText
property bool textFieldEditable: true
implicitHeight: 74
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
Rectangle {
id: backgroud
ColumnLayout {
id: content
anchors.fill: parent
color: "#1c1d21"
radius: 16
border.color: textField.focus ? "#d7d8db" : "#2C2D30"
border.width: 1
Behavior on border.color {
PropertyAnimation { duration: 200 }
}
}
Rectangle {
id: backgroud
Layout.fillWidth: true
Layout.preferredHeight: 74
color: "#1c1d21"
radius: 16
border.color: textField.focus ? "#d7d8db" : "#2C2D30"
border.width: 1
RowLayout {
anchors.fill: backgroud
ColumnLayout {
LabelTextType {
text: root.headerText
color: "#878b91"
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.topMargin: 16
Behavior on border.color {
PropertyAnimation { duration: 200 }
}
TextField {
id: textField
RowLayout {
anchors.fill: backgroud
ColumnLayout {
LabelTextType {
text: root.headerText
color: "#878b91"
enabled: root.textFieldEditable
color: "#d7d8db"
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.topMargin: 16
}
placeholderText: textFieldPlaceholderText
placeholderTextColor: "#494B50"
TextField {
id: textField
selectionColor: "#412102"
selectedTextColor: "#D7D8DB"
enabled: root.textFieldEditable
color: "#d7d8db"
font.pixelSize: 16
font.weight: 400
font.family: "PT Root UI VF"
placeholderText: textFieldPlaceholderText
placeholderTextColor: "#494B50"
height: 24
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
topPadding: 0
rightPadding: 0
leftPadding: 0
bottomPadding: 0
selectionColor: "#412102"
selectedTextColor: "#D7D8DB"
background: Rectangle {
anchors.fill: parent
color: "#1c1d21"
font.pixelSize: 16
font.weight: 400
font.family: "PT Root UI VF"
height: 24
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
topPadding: 0
rightPadding: 0
leftPadding: 0
bottomPadding: 0
background: Rectangle {
anchors.fill: parent
color: "#1c1d21"
}
onTextChanged: {
root.errorText = ""
}
}
}
BasicButtonType {
visible: root.buttonText !== ""
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
borderWidth: 0
text: buttonText
Layout.rightMargin: 24
onClicked: {
if (clickedFunc && typeof clickedFunc === "function") {
clickedFunc()
}
}
}
}
}
BasicButtonType {
visible: root.buttonText !== ""
SmallTextType {
id: errorField
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
borderWidth: 0
text: buttonText
Layout.rightMargin: 24
onClicked: {
if (clickedFunc && typeof clickedFunc === "function") {
clickedFunc()
}
}
text: root.errorText
visible: root.errorText !== ""
color: "#EB5757"
}
}
}