widgets: remove duplicate import

Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
This commit is contained in:
Wagner Riffel 2019-09-12 23:16:37 -03:00 committed by Drew DeVault
parent e2d5c456dc
commit ecc26b53c9
1 changed files with 17 additions and 18 deletions

View File

@ -14,7 +14,6 @@ import (
"git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib" "git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/lib/ui" "git.sr.ht/~sircmpwn/aerc/lib/ui"
libui "git.sr.ht/~sircmpwn/aerc/lib/ui"
) )
type Aerc struct { type Aerc struct {
@ -23,15 +22,15 @@ type Aerc struct {
cmdHistory lib.History cmdHistory lib.History
complete func(cmd string) []string complete func(cmd string) []string
conf *config.AercConfig conf *config.AercConfig
focused libui.Interactive focused ui.Interactive
grid *libui.Grid grid *ui.Grid
logger *log.Logger logger *log.Logger
simulating int simulating int
statusbar *libui.Stack statusbar *ui.Stack
statusline *StatusLine statusline *StatusLine
pendingKeys []config.KeyStroke pendingKeys []config.KeyStroke
prompts *libui.Stack prompts *ui.Stack
tabs *libui.Tabs tabs *ui.Tabs
beep func() error beep func() error
} }
@ -39,18 +38,18 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
cmd func(cmd []string) error, complete func(cmd string) []string, cmd func(cmd []string) error, complete func(cmd string) []string,
cmdHistory lib.History) *Aerc { cmdHistory lib.History) *Aerc {
tabs := libui.NewTabs() tabs := ui.NewTabs()
statusbar := ui.NewStack() statusbar := ui.NewStack()
statusline := NewStatusLine() statusline := NewStatusLine()
statusbar.Push(statusline) statusbar.Push(statusline)
grid := libui.NewGrid().Rows([]libui.GridSpec{ grid := ui.NewGrid().Rows([]ui.GridSpec{
{libui.SIZE_EXACT, 1}, {ui.SIZE_EXACT, 1},
{libui.SIZE_WEIGHT, 1}, {ui.SIZE_WEIGHT, 1},
{libui.SIZE_EXACT, 1}, {ui.SIZE_EXACT, 1},
}).Columns([]libui.GridSpec{ }).Columns([]ui.GridSpec{
{libui.SIZE_WEIGHT, 1}, {ui.SIZE_WEIGHT, 1},
}) })
grid.AddChild(tabs.TabStrip) grid.AddChild(tabs.TabStrip)
grid.AddChild(tabs.TabContent).At(1, 0) grid.AddChild(tabs.TabContent).At(1, 0)
@ -66,7 +65,7 @@ func NewAerc(conf *config.AercConfig, logger *log.Logger,
logger: logger, logger: logger,
statusbar: statusbar, statusbar: statusbar,
statusline: statusline, statusline: statusline,
prompts: libui.NewStack(), prompts: ui.NewStack(),
tabs: tabs, tabs: tabs,
} }
@ -144,8 +143,8 @@ func (aerc *Aerc) Children() []ui.Drawable {
return aerc.grid.Children() return aerc.grid.Children()
} }
func (aerc *Aerc) OnInvalidate(onInvalidate func(d libui.Drawable)) { func (aerc *Aerc) OnInvalidate(onInvalidate func(d ui.Drawable)) {
aerc.grid.OnInvalidate(func(_ libui.Drawable) { aerc.grid.OnInvalidate(func(_ ui.Drawable) {
onInvalidate(aerc) onInvalidate(aerc)
}) })
} }
@ -158,7 +157,7 @@ func (aerc *Aerc) Focus(focus bool) {
// who cares // who cares
} }
func (aerc *Aerc) Draw(ctx *libui.Context) { func (aerc *Aerc) Draw(ctx *ui.Context) {
aerc.grid.Draw(ctx) aerc.grid.Draw(ctx)
} }
@ -348,7 +347,7 @@ func (aerc *Aerc) PushError(text string) {
aerc.PushStatus(text, 10*time.Second).Color(tcell.ColorDefault, tcell.ColorRed) aerc.PushStatus(text, 10*time.Second).Color(tcell.ColorDefault, tcell.ColorRed)
} }
func (aerc *Aerc) focus(item libui.Interactive) { func (aerc *Aerc) focus(item ui.Interactive) {
if aerc.focused == item { if aerc.focused == item {
return return
} }