Documentation ¶
Index ¶
- Constants
- type Application
- func (app *Application) Draw()
- func (app *Application) HandleEvent(ev tcell.Event) bool
- func (app *Application) Lyrics(song song.Song) lyrics.Lyrics
- func (app *Application) PostFunc(fn func()) error
- func (app *Application) Quit()
- func (app *Application) Resize()
- func (app *Application) Run() error
- func (app *Application) SetView(view views.View)
- func (app *Application) Update()
- type LyricsWidget
- func (w *LyricsWidget) Cancel()
- func (w *LyricsWidget) Draw()
- func (w *LyricsWidget) HandleEvent(ev tcell.Event) bool
- func (w *LyricsWidget) Resize()
- func (w *LyricsWidget) Scroll(d ScrollDirection)
- func (w *LyricsWidget) SetLine(line string)
- func (w *LyricsWidget) SetScroll(v bool)
- func (w *LyricsWidget) SetView(view views.View)
- func (w *LyricsWidget) Size() (int, int)
- func (w *LyricsWidget) Update(status status.Status, lyrics lyrics.Lyrics)
- type ScrollDirection
Constants ¶
const ( ScrollUp = ScrollDirection(tcell.KeyUp) ScrollDown = ScrollDirection(tcell.KeyDown) ScrollRight = ScrollDirection(tcell.KeyRight) ScrollLeft = ScrollDirection(tcell.KeyLeft) )
Constants of type ScrollDirection.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { tcell.Screen // contains filtered or unexported fields }
Application struct. It embeds and overrides views.Application. It also implemets views.Widget so that it can be used as the root Widget. Call (*Application).Run to run.
func NewApplication ¶
func NewApplication(cfg *config.Config) *Application
NewApplication allocates new Application from cfg.
func (*Application) HandleEvent ¶
func (app *Application) HandleEvent(ev tcell.Event) bool
HandleEvent handles dem events.
func (*Application) Lyrics ¶ added in v0.3.0
func (app *Application) Lyrics(song song.Song) lyrics.Lyrics
Lyrics fetches lyrics using information from song.
func (*Application) PostFunc ¶ added in v0.3.0
func (app *Application) PostFunc(fn func()) error
PostFunc runs function fn in the event loop.
func (*Application) SetView ¶
func (app *Application) SetView(view views.View)
SetView updates the views of subwidgets.
func (*Application) Update ¶ added in v0.3.0
func (app *Application) Update()
Update subwidgets after querying information from client.
type LyricsWidget ¶
type LyricsWidget struct {
// contains filtered or unexported fields
}
LyricsWidget is a Widget implementation.
func NewLyricsWidget ¶
func NewLyricsWidget(app *Application, quit chan struct{}) *LyricsWidget
NewLyricsWidget allocates new LyricsWidget.
func (*LyricsWidget) Cancel ¶ added in v0.3.0
func (w *LyricsWidget) Cancel()
func (*LyricsWidget) Draw ¶ added in v0.3.0
func (w *LyricsWidget) Draw()
func (*LyricsWidget) HandleEvent ¶
func (w *LyricsWidget) HandleEvent(ev tcell.Event) bool
func (*LyricsWidget) Resize ¶ added in v0.3.0
func (w *LyricsWidget) Resize()
func (*LyricsWidget) Scroll ¶
func (w *LyricsWidget) Scroll(d ScrollDirection)
Scroll in the direction represented by d.
func (*LyricsWidget) SetLine ¶ added in v0.3.0
func (w *LyricsWidget) SetLine(line string)
func (*LyricsWidget) SetScroll ¶
func (w *LyricsWidget) SetScroll(v bool)
func (*LyricsWidget) SetView ¶ added in v0.3.0
func (w *LyricsWidget) SetView(view views.View)
func (*LyricsWidget) Size ¶ added in v0.3.0
func (w *LyricsWidget) Size() (int, int)
type ScrollDirection ¶
type ScrollDirection tcell.Key
ScrollDirection represents scroll direction for Scroll methods.