Refine lifecycle setup screen

This commit is contained in:
Joe Julian
2026-03-29 14:00:20 -07:00
parent 01e06deeef
commit 7e2e396264
3 changed files with 66 additions and 35 deletions
+14 -15
View File
@@ -32,8 +32,7 @@ import (
type entry = vault.Entry
const (
productName = "KeePassGO"
desktopSubtitle = "KeePass-compatible password management for desktop-first workflows"
productName = "KeePassGO"
)
const maxAttachmentBytes = 10 << 20
@@ -124,6 +123,8 @@ type ui struct {
showEntries widget.Clickable
showTemplates widget.Clickable
showRecycle widget.Clickable
showLocalLifecycle widget.Clickable
showRemoteLifecycle widget.Clickable
masterKeyPasswordOnly widget.Clickable
masterKeyKeyFileOnly widget.Clickable
masterKeyComposite widget.Clickable
@@ -150,6 +151,7 @@ type ui struct {
copyIcon *widget.Icon
clipboardWriter clipboard.Writer
loadingMessage string
lifecycleMode string
keyboardFocus focusID
}
@@ -225,6 +227,7 @@ func newUIWithState(mode string, sess appstate.CurrentSession) *ui {
state: appstate.State{},
masterKeyMode: vault.MasterKeyModePasswordOnly,
selectedHistoryIndex: -1,
lifecycleMode: "local",
}
u.state.Session = sess
u.phoneSplit.Value = 0.46
@@ -679,6 +682,12 @@ func (u *ui) layout(gtx layout.Context) layout.Dimensions {
for u.showRecycle.Clicked(gtx) {
u.showRecycleBinSection()
}
for u.showLocalLifecycle.Clicked(gtx) {
u.lifecycleMode = "local"
}
for u.showRemoteLifecycle.Clicked(gtx) {
u.lifecycleMode = "remote"
}
for u.lockVault.Clicked(gtx) {
u.runAction("lock vault", u.lockAction)
}
@@ -830,19 +839,9 @@ func (u *ui) header(gtx layout.Context) layout.Dimensions {
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
return layout.Flex{Alignment: layout.Middle}.Layout(gtx,
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
lbl := material.Label(u.theme, unit.Sp(24), "Vault")
lbl.Text = productName
lbl.Color = accentColor
return lbl.Layout(gtx)
}),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
lbl := material.Label(u.theme, unit.Sp(13), desktopSubtitle)
lbl.Color = mutedColor
return lbl.Layout(gtx)
}),
)
lbl := material.Label(u.theme, unit.Sp(24), productName)
lbl.Color = accentColor
return lbl.Layout(gtx)
}),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
btn := material.Button(u.theme, &u.lockVault, "Lock")