Merge commit '7651b3b' into merge-main-13-seg13-copy-reveal
This commit is contained in:
@@ -475,6 +475,9 @@ func (u *ui) describeActionError(label string, err error) string {
|
||||
if errors.Is(err, webdav.ErrConflict) || strings.Contains(err.Error(), webdav.ErrConflict.Error()) {
|
||||
return "Save conflict: the remote vault changed. Reopen it and retry the save."
|
||||
}
|
||||
if label == "open remote vault" {
|
||||
return fmt.Sprintf("%s failed: %v", label, err)
|
||||
}
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
@@ -736,6 +739,8 @@ func (u *ui) header(gtx layout.Context) layout.Dimensions {
|
||||
}),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(8)}.Layout),
|
||||
layout.Rigid(u.lifecycleControls),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(8)}.Layout),
|
||||
layout.Rigid(u.feedbackBanner),
|
||||
)
|
||||
})
|
||||
}
|
||||
@@ -766,6 +771,8 @@ func (u *ui) header(gtx layout.Context) layout.Dimensions {
|
||||
}),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(10)}.Layout),
|
||||
layout.Rigid(u.lifecycleControls),
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(10)}.Layout),
|
||||
layout.Rigid(u.feedbackBanner),
|
||||
)
|
||||
})
|
||||
}
|
||||
@@ -1303,6 +1310,27 @@ func detailLine(th *material.Theme, label, value string) layout.Widget {
|
||||
}
|
||||
}
|
||||
|
||||
func (u *ui) feedbackBanner(gtx layout.Context) layout.Dimensions {
|
||||
message := u.statusMessage
|
||||
tone := color.NRGBA{R: 231, G: 239, B: 235, A: 255}
|
||||
textColor := accentColor
|
||||
if u.errorMessage != "" {
|
||||
message = u.errorMessage
|
||||
tone = color.NRGBA{R: 248, G: 226, B: 223, A: 255}
|
||||
textColor = color.NRGBA{R: 140, G: 46, B: 34, A: 255}
|
||||
}
|
||||
if message == "" {
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
return layout.Background{}.Layout(gtx, fill(tone), func(gtx layout.Context) layout.Dimensions {
|
||||
return layout.UniformInset(unit.Dp(10)).Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
lbl := material.Label(u.theme, unit.Sp(13), message)
|
||||
lbl.Color = textColor
|
||||
return lbl.Layout(gtx)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (u *ui) passwordLine(label, value string) layout.Widget {
|
||||
return func(gtx layout.Context) layout.Dimensions {
|
||||
icon := u.eyeIcon
|
||||
|
||||
Reference in New Issue
Block a user