internal

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2021 License: MIT-0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
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) Draw

func (app *Application) Draw()

Draw implements the root Widget.

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) Quit

func (app *Application) Quit()

Quit the application.

func (*Application) Resize

func (app *Application) Resize()

Resize does resize actions.

func (*Application) Run

func (app *Application) Run() error

Run the application.

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)

func (*LyricsWidget) Update added in v0.3.0

func (w *LyricsWidget) Update(status status.Status, lyrics lyrics.Lyrics)

type ScrollDirection

type ScrollDirection tcell.Key

ScrollDirection represents scroll direction for Scroll methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL