Extract qs.Ui.TextField, migrate wifi passphrase + settings + dynamic form
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user