Add KeePassGO branding assets
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
"git.julianfamily.org/keepassgo/apiapproval"
|
||||
"git.julianfamily.org/keepassgo/apiaudit"
|
||||
"git.julianfamily.org/keepassgo/apitokens"
|
||||
keepassassets "git.julianfamily.org/keepassgo/assets"
|
||||
"git.julianfamily.org/keepassgo/appstate"
|
||||
"git.julianfamily.org/keepassgo/clipboard"
|
||||
"git.julianfamily.org/keepassgo/passwords"
|
||||
@@ -130,6 +131,8 @@ const (
|
||||
type ui struct {
|
||||
mode string
|
||||
theme *material.Theme
|
||||
logoHorizontal paint.ImageOp
|
||||
splashSquare paint.ImageOp
|
||||
search widget.Editor
|
||||
vaultPath widget.Editor
|
||||
saveAsPath widget.Editor
|
||||
@@ -342,8 +345,10 @@ func newUIWithState(mode string, sess appstate.CurrentSession, paths statePaths)
|
||||
th.Palette.ContrastFg = color.NRGBA{R: 255, G: 252, B: 247, A: 255}
|
||||
|
||||
u := &ui{
|
||||
mode: mode,
|
||||
theme: th,
|
||||
mode: mode,
|
||||
theme: th,
|
||||
logoHorizontal: paint.NewImageOp(keepassassets.MustPNG("keepassgo-logo-horizontal.png")),
|
||||
splashSquare: paint.NewImageOp(keepassassets.MustPNG("keepassgo-splash-square.png")),
|
||||
search: widget.Editor{
|
||||
SingleLine: true,
|
||||
Submit: false,
|
||||
@@ -2040,6 +2045,8 @@ func (u *ui) lifecycleScreen(gtx layout.Context) layout.Dimensions {
|
||||
}
|
||||
return panel(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
rows := []layout.Widget{
|
||||
u.lifecycleBranding,
|
||||
layout.Spacer{Height: unit.Dp(8)}.Layout,
|
||||
u.lifecycleControls,
|
||||
}
|
||||
return material.List(u.theme, &u.lifecycleList).Layout(gtx, len(rows), func(gtx layout.Context, i int) layout.Dimensions {
|
||||
@@ -2367,9 +2374,7 @@ func (u *ui) header(gtx layout.Context) 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 {
|
||||
lbl := material.Label(u.theme, unit.Sp(20), productName)
|
||||
lbl.Color = accentColor
|
||||
return lbl.Layout(gtx)
|
||||
return u.brandMark(gtx, 132, 42)
|
||||
}),
|
||||
layout.Rigid(u.headerActions),
|
||||
)
|
||||
@@ -2381,9 +2386,7 @@ func (u *ui) header(gtx layout.Context) layout.Dimensions {
|
||||
return card(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Flex{Alignment: layout.Middle}.Layout(gtx,
|
||||
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
|
||||
lbl := material.Label(u.theme, unit.Sp(24), productName)
|
||||
lbl.Color = accentColor
|
||||
return lbl.Layout(gtx)
|
||||
return u.brandMark(gtx, 196, 56)
|
||||
}),
|
||||
layout.Rigid(u.headerActions),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user