diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-05-28 10:32:42 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-28 10:32:42 -0400 |
commit | caad1b2c06a0446059ee5ee916e3dce1794b159b (patch) | |
tree | ee81255485234137a5902d87d5960ac06618b341 /widgets/getpasswd.go | |
parent | 76a91813d8dc0f0011202f8120fc197097f022aa (diff) | |
download | aerc-caad1b2c06a0446059ee5ee916e3dce1794b159b.tar.gz |
Revert "Add Style configuration"
This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
Diffstat (limited to 'widgets/getpasswd.go')
-rw-r--r-- | widgets/getpasswd.go | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/widgets/getpasswd.go b/widgets/getpasswd.go index b3ea9e07..34f8b1f5 100644 --- a/widgets/getpasswd.go +++ b/widgets/getpasswd.go @@ -5,7 +5,6 @@ import ( "github.com/gdamore/tcell" - "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib/ui" ) @@ -15,16 +14,14 @@ type GetPasswd struct { title string prompt string input *ui.TextInput - conf *config.AercConfig } -func NewGetPasswd(title string, prompt string, conf *config.AercConfig, cb func(string, error)) *GetPasswd { +func NewGetPasswd(title string, prompt string, cb func(string, error)) *GetPasswd { getpasswd := &GetPasswd{ callback: cb, title: title, prompt: prompt, - conf: conf, - input: ui.NewTextInput("", conf.Ui).Password(true).Prompt("Password: "), + input: ui.NewTextInput("").Password(true).Prompt("Password: "), } getpasswd.input.OnInvalidate(func(_ ui.Drawable) { getpasswd.Invalidate() @@ -34,13 +31,10 @@ func NewGetPasswd(title string, prompt string, conf *config.AercConfig, cb func( } func (gp *GetPasswd) Draw(ctx *ui.Context) { - defaultStyle := gp.conf.Ui.GetStyle(config.STYLE_DEFAULT) - titleStyle := gp.conf.Ui.GetStyle(config.STYLE_TITLE) - - ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', defaultStyle) - ctx.Fill(0, 0, ctx.Width(), 1, ' ', titleStyle) - ctx.Printf(1, 0, titleStyle, "%s", gp.title) - ctx.Printf(1, 1, defaultStyle, gp.prompt) + ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault) + ctx.Fill(0, 0, ctx.Width(), 1, ' ', tcell.StyleDefault.Reverse(true)) + ctx.Printf(1, 0, tcell.StyleDefault.Reverse(true), "%s", gp.title) + ctx.Printf(1, 1, tcell.StyleDefault, gp.prompt) gp.input.Draw(ctx.Subcontext(1, 3, ctx.Width()-2, 1)) } |