Extract qs.Ui.TextField, migrate wifi passphrase + settings + dynamic form
This commit is contained in:
@@ -1090,29 +1090,15 @@ iwctl known-networks list 2>/dev/null \\
|
||||
anchors.right: connectPwBtn.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.rightMargin: 6
|
||||
echoMode: TextInput.Password
|
||||
password: true
|
||||
placeholderText: "Passphrase"
|
||||
font.family: root.bar.fontFamily
|
||||
font.pixelSize: 12
|
||||
color: root.bar.foreground
|
||||
selectionColor: Qt.rgba(root.bar.foreground.r, root.bar.foreground.g, root.bar.foreground.b, 0.35)
|
||||
selectedTextColor: root.bar.foreground
|
||||
placeholderTextColor: Qt.darker(root.bar.foreground, 1.6)
|
||||
leftPadding: 8
|
||||
rightPadding: 8
|
||||
topPadding: 6
|
||||
bottomPadding: 6
|
||||
foreground: root.bar.foreground
|
||||
horizontalPadding: 8
|
||||
verticalPadding: 6
|
||||
enabled: !row.isBusy
|
||||
|
||||
background: Rectangle {
|
||||
color: Qt.rgba(root.bar.foreground.r, root.bar.foreground.g, root.bar.foreground.b, pwField.activeFocus ? 0.10 : 0.05)
|
||||
border.color: pwField.activeFocus
|
||||
? Qt.rgba(root.bar.foreground.r, root.bar.foreground.g, root.bar.foreground.b, 0.45)
|
||||
: Qt.rgba(root.bar.foreground.r, root.bar.foreground.g, root.bar.foreground.b, 0.20)
|
||||
border.width: 1
|
||||
radius: 4
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
if (!root.busy && row.net && text.length > 0) root.connectWithPassphrase(row.net.ssid, text)
|
||||
}
|
||||
|
||||
@@ -699,6 +699,66 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- TextField -----------------------------------------------------
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 8
|
||||
|
||||
Text {
|
||||
text: "TextField"
|
||||
color: root.foreground
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
}
|
||||
Text {
|
||||
text: "Single-line input. Inherits Qt Quick Controls TextField, swaps in the kit's focus chrome and selection styling. Toggle `password: true` for masked entry."
|
||||
color: Qt.darker(root.foreground, 1.5)
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: 10
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
implicitHeight: tfCol.implicitHeight + 24
|
||||
color: Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b, 0.04)
|
||||
radius: 6
|
||||
border.color: Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b, 0.10)
|
||||
border.width: 1
|
||||
|
||||
Column {
|
||||
id: tfCol
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: 14
|
||||
anchors.rightMargin: 14
|
||||
spacing: 10
|
||||
|
||||
TextField {
|
||||
width: parent.width
|
||||
placeholderText: "Type something"
|
||||
foreground: root.foreground
|
||||
accent: root.accent
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: 12
|
||||
}
|
||||
|
||||
TextField {
|
||||
width: parent.width
|
||||
password: true
|
||||
placeholderText: "Password"
|
||||
foreground: root.foreground
|
||||
accent: root.accent
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Toggle --------------------------------------------------------
|
||||
Column {
|
||||
width: parent.width
|
||||
|
||||
@@ -1210,28 +1210,13 @@ Item {
|
||||
width: parent ? parent.width : 0
|
||||
|
||||
component CalendarField: TextField {
|
||||
id: calField
|
||||
property string fieldKey: ""
|
||||
width: parent.width
|
||||
foreground: root.foreground
|
||||
accent: root.accent
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: 12
|
||||
width: parent.width
|
||||
color: root.foreground
|
||||
selectionColor: Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b, 0.35)
|
||||
selectedTextColor: root.foreground
|
||||
placeholderTextColor: Qt.darker(root.foreground, 1.6)
|
||||
leftPadding: 10
|
||||
rightPadding: 10
|
||||
topPadding: 7
|
||||
bottomPadding: 7
|
||||
onEditingFinished: if (fieldKey) calForm.fieldChanged(fieldKey, text)
|
||||
background: Rectangle {
|
||||
color: Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b,
|
||||
calField.activeFocus ? 0.08 : 0.04)
|
||||
border.color: calField.activeFocus
|
||||
? Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b, 0.4)
|
||||
: Qt.rgba(root.foreground.r, root.foreground.g, root.foreground.b, 0.18)
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
|
||||
Reference in New Issue
Block a user