Extract qs.Ui.TextField, migrate wifi passphrase + settings + dynamic form

This commit is contained in:
Ryan Hughes
2026-05-18 00:22:50 -04:00
parent 64115a9cb4
commit 1dd30e5c28
7 changed files with 120 additions and 53 deletions
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qs.Ui
// Generic schema-driven settings form. The host panel passes:
// - schema: array of { key, label, type, defaultValue?, options?, min?, max?, step?, description? }
@@ -83,30 +84,14 @@ Column {
Component {
id: stringField
TextField {
id: stringControl
property string fieldKey: ""
property var field: ({})
width: parent.width
foreground: root.foregroundColor
font.family: root.fontFamilyName
font.pixelSize: 12
color: root.foregroundColor
selectionColor: Qt.rgba(root.foregroundColor.r, root.foregroundColor.g, root.foregroundColor.b, 0.35)
selectedTextColor: root.foregroundColor
placeholderTextColor: Qt.darker(root.foregroundColor, 1.6)
leftPadding: 10
rightPadding: 10
topPadding: 7
bottomPadding: 7
text: root.currentValue(field) === undefined ? "" : String(root.currentValue(field))
onEditingFinished: if (fieldKey) root.fieldChanged(fieldKey, text)
background: Rectangle {
color: Qt.rgba(root.foregroundColor.r, root.foregroundColor.g, root.foregroundColor.b,
stringControl.activeFocus ? 0.08 : 0.04)
border.color: stringControl.activeFocus
? Qt.rgba(root.foregroundColor.r, root.foregroundColor.g, root.foregroundColor.b, 0.4)
: Qt.rgba(root.foregroundColor.r, root.foregroundColor.g, root.foregroundColor.b, 0.18)
border.width: 1
}
}
}