summaryrefslogtreecommitdiff
path: root/widgets/getpasswd.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-07-30 23:22:32 +0200
committerReto Brunner <reto@labrat.space>2020-07-30 23:22:32 +0200
commit3d784c5d8c7d037e38159fc1753773a2e81aa43e (patch)
tree2c062c9f4b4641a59e3f4f3ff3317f636bfd49cf /widgets/getpasswd.go
parent6ee7b1c3fd40b0e2f93dcaa7ffb3b0bdd56ac285 (diff)
downloadaerc-3d784c5d8c7d037e38159fc1753773a2e81aa43e.zip
Revert "Implement style configuration."
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
Diffstat (limited to 'widgets/getpasswd.go')
-rw-r--r--widgets/getpasswd.go19
1 files changed, 6 insertions, 13 deletions
diff --git a/widgets/getpasswd.go b/widgets/getpasswd.go
index 3cdc5cf..34f8b1f 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,17 +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()
@@ -35,13 +31,10 @@ func NewGetPasswd(title string, prompt string, conf *config.AercConfig,
}
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))
}