Skip to content

Commit b81d677

Browse files
committed
feat(hotspot): mask the password with a reveal toggle
The hotspot password rendered in plain text. Default to a masked field (echoMode Password) with an eye IconToolbarButton to show/hide it.
1 parent 97632cf commit b81d677

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

quickshell/ii/modules/ii/sidebarRight/hotspot/HotspotDialog.qml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,30 @@ WindowDialog {
8383
onTextChanged: root.fSsid = text
8484
}
8585

86-
// Password
87-
MaterialTextField {
88-
id: passwordField
86+
// Password (masked by default; the eye toggles reveal)
87+
RowLayout {
8988
Layout.fillWidth: true
90-
placeholderText: Translation.tr("Password (8+ characters)")
91-
text: root.fPassword
92-
onTextChanged: root.fPassword = text
93-
inputMethodHints: Qt.ImhSensitiveData
89+
spacing: 4
90+
MaterialTextField {
91+
id: passwordField
92+
Layout.fillWidth: true
93+
property bool revealed: false
94+
placeholderText: Translation.tr("Password (8+ characters)")
95+
text: root.fPassword
96+
onTextChanged: root.fPassword = text
97+
echoMode: revealed ? TextInput.Normal : TextInput.Password
98+
inputMethodHints: Qt.ImhSensitiveData
99+
}
100+
IconToolbarButton {
101+
Layout.preferredHeight: passwordField.implicitHeight
102+
Layout.preferredWidth: Layout.preferredHeight
103+
text: passwordField.revealed ? "visibility_off" : "visibility"
104+
toggled: passwordField.revealed
105+
onClicked: passwordField.revealed = !passwordField.revealed
106+
StyledToolTip {
107+
text: passwordField.revealed ? Translation.tr("Hide password") : Translation.tr("Show password")
108+
}
109+
}
94110
}
95111
StyledText {
96112
visible: !root.passwordValid

0 commit comments

Comments
 (0)