Simplify locked vault screen
This commit is contained in:
@@ -953,6 +953,10 @@ func (u *ui) shouldShowLifecycleSetup() bool {
|
||||
return !u.hasOpenVault()
|
||||
}
|
||||
|
||||
func (u *ui) shouldUseLockedSinglePane() bool {
|
||||
return u.isVaultLocked() && !u.shouldShowLifecycleSetup()
|
||||
}
|
||||
|
||||
func (u *ui) chooseExistingFileAction(target *widget.Editor) error {
|
||||
path, err := pickExistingFile()
|
||||
if err != nil {
|
||||
@@ -1226,6 +1230,9 @@ func (u *ui) layout(gtx layout.Context) layout.Dimensions {
|
||||
if u.shouldShowLifecycleSetup() {
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
if u.shouldUseLockedSinglePane() {
|
||||
return u.detailPanel(gtx)
|
||||
}
|
||||
if u.mode == "phone" || gtx.Constraints.Max.X < gtx.Dp(unit.Dp(720)) {
|
||||
u.phoneSpan = gtx.Constraints.Max.Y
|
||||
listHeight := int(float32(gtx.Constraints.Max.Y) * u.phoneSplit.Value)
|
||||
@@ -1316,8 +1323,7 @@ func (u *ui) headerActions(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
if u.isVaultLocked() {
|
||||
btn := material.Button(u.theme, &u.unlockVault, "Unlock")
|
||||
return btn.Layout(gtx)
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
return layout.Flex{Spacing: layout.SpaceStart}.Layout(gtx,
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
|
||||
Reference in New Issue
Block a user