Reset password peek across view changes

This commit is contained in:
Joe Julian
2026-03-29 17:27:19 -07:00
parent 4a3e52ec1c
commit 3066442c1b
4 changed files with 75 additions and 5 deletions
+8 -4
View File
@@ -26,7 +26,9 @@ func (u *ui) lifecycleControls(gtx layout.Context) layout.Dimensions {
)
}),
layout.Rigid(layout.Spacer{Height: unit.Dp(8)}.Layout),
layout.Rigid(labeledEditorHelp(u.theme, "Master Password", "Leave blank if this vault is protected by key file only.", &u.masterPassword, true)),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
return u.masterPasswordField(gtx, "Leave blank if this vault is protected by key file only.")
}),
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
layout.Rigid(selectorEditorHelp(u.theme, "Key File", "Optional path to a KeePass-compatible key file.", &u.keyFilePath, &u.pickKeyFile, "Choose File", false)),
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
@@ -490,7 +492,9 @@ func selectorEditorHelp(th *material.Theme, label, help string, editor *widget.E
func (u *ui) unlockPanel(gtx layout.Context) layout.Dimensions {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(u.unlockPasswordField),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
return u.masterPasswordField(gtx, "Used alone or together with a key file to unlock the vault.")
}),
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
layout.Rigid(selectorEditorHelp(u.theme, "Key File", "Optional path to a KeePass-compatible key file.", &u.keyFilePath, &u.pickKeyFile, "Choose File", false)),
layout.Rigid(layout.Spacer{Height: unit.Dp(8)}.Layout),
@@ -500,7 +504,7 @@ func (u *ui) unlockPanel(gtx layout.Context) layout.Dimensions {
)
}
func (u *ui) unlockPasswordField(gtx layout.Context) layout.Dimensions {
func (u *ui) masterPasswordField(gtx layout.Context, help string) layout.Dimensions {
icon := u.eyeIcon
desc := "Show master password"
mask := rune('•')
@@ -542,7 +546,7 @@ func (u *ui) unlockPasswordField(gtx layout.Context) layout.Dimensions {
}),
layout.Rigid(layout.Spacer{Height: unit.Dp(2)}.Layout),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
lbl := material.Label(u.theme, unit.Sp(11), "Used alone or together with a key file to unlock the vault.")
lbl := material.Label(u.theme, unit.Sp(11), help)
lbl.Color = mutedColor
return lbl.Layout(gtx)
}),