Collapse empty phone detail pane
This commit is contained in:
@@ -1078,6 +1078,17 @@ func (u *ui) shouldShowDesktopWorkingHeader() bool {
|
||||
return u.mode == "desktop" && !u.shouldShowLifecycleSetup() && !u.isVaultLocked()
|
||||
}
|
||||
|
||||
func (u *ui) shouldUseCompactPhoneDetailPane() bool {
|
||||
if u.mode != "phone" {
|
||||
return false
|
||||
}
|
||||
if u.isVaultLocked() || u.editingEntry {
|
||||
return false
|
||||
}
|
||||
_, ok := u.selectedEntry()
|
||||
return !ok
|
||||
}
|
||||
|
||||
func (u *ui) chooseExistingFileAction(target *widget.Editor) error {
|
||||
path, err := pickExistingFile()
|
||||
if err != nil {
|
||||
@@ -1384,7 +1395,12 @@ func (u *ui) layout(gtx layout.Context) layout.Dimensions {
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
|
||||
layout.Rigid(u.phoneSlider),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
|
||||
layout.Flexed(1, u.detailPanel),
|
||||
func() layout.FlexChild {
|
||||
if u.shouldUseCompactPhoneDetailPane() {
|
||||
return layout.Rigid(u.detailPanel)
|
||||
}
|
||||
return layout.Flexed(1, u.detailPanel)
|
||||
}(),
|
||||
)
|
||||
}
|
||||
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||
|
||||
Reference in New Issue
Block a user