Tighten Android lifecycle screen layout
This commit is contained in:
@@ -2371,6 +2371,9 @@ func (u *ui) syncPasswordField(gtx layout.Context) layout.Dimensions {
|
||||
|
||||
func (u *ui) header(gtx layout.Context) layout.Dimensions {
|
||||
if u.mode == "phone" {
|
||||
if u.shouldShowLifecycleSetup() || u.isVaultLocked() {
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
return compactCard(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Flex{Alignment: layout.Middle}.Layout(gtx,
|
||||
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
|
||||
|
||||
+1
-3
@@ -13,9 +13,7 @@ func (u *ui) lifecycleBranding(gtx layout.Context) layout.Dimensions {
|
||||
if u.mode != "phone" {
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
return layout.Center.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
return u.brandImage(gtx, u.splashSquare, 132, 132)
|
||||
})
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
|
||||
func (u *ui) brandMark(gtx layout.Context, widthDP, heightDP float32) layout.Dimensions {
|
||||
|
||||
+15
@@ -473,6 +473,21 @@ func labeledEditorHelpFocus(th *material.Theme, label, help string, editor *widg
|
||||
|
||||
func selectorEditorHelp(th *material.Theme, label, help string, editor *widget.Editor, click *widget.Clickable, buttonLabel string, sensitive bool) layout.Widget {
|
||||
return func(gtx layout.Context) layout.Dimensions {
|
||||
if gtx.Constraints.Max.X <= gtx.Dp(unit.Dp(420)) {
|
||||
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
|
||||
layout.Rigid(labeledEditor(th, label, editor, sensitive)),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
return tonedButton(gtx, th, click, buttonLabel)
|
||||
}),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(2)}.Layout),
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
lbl := material.Label(th, unit.Sp(11), help)
|
||||
lbl.Color = mutedColor
|
||||
return lbl.Layout(gtx)
|
||||
}),
|
||||
)
|
||||
}
|
||||
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Flex{Alignment: layout.Middle}.Layout(gtx,
|
||||
|
||||
Reference in New Issue
Block a user