Give identity its due: native enrollment, honest deletion, and sign-in that stays home
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
// A row whose trailing control is a masked field that can be emptied on demand.
|
||||
//
|
||||
// PasswordRow already reports every keystroke, which is what comparing two
|
||||
// entries as they are typed needs. What it cannot do is forget: its field is
|
||||
// private, so a form that closed left the typed password sitting in a hidden
|
||||
// TextInput for the rest of the session.
|
||||
//
|
||||
// This exposes `clear()` so the page that owns a form can empty it when the
|
||||
// form succeeds or closes, which is the only difference between the two.
|
||||
|
||||
import QtQuick
|
||||
import qs.config
|
||||
|
||||
SettingRow {
|
||||
id: root
|
||||
|
||||
property string placeholder: "Password"
|
||||
property bool enabled: true
|
||||
|
||||
signal changed(value: string)
|
||||
signal accepted
|
||||
|
||||
controlWidth: 220
|
||||
|
||||
function clear(): void {
|
||||
field.clear();
|
||||
root.changed("");
|
||||
}
|
||||
|
||||
PasswordField {
|
||||
id: field
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: root.controlWidth
|
||||
enabled: root.enabled
|
||||
opacity: root.enabled ? 1 : 0.5
|
||||
placeholder: root.placeholder
|
||||
onTextChanged: root.changed(field.text)
|
||||
onAccepted: root.accepted()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user