internal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT-0 Imports: 15 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
	*views.Application

	WW *views.WidgetWatchers
	// 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) (app *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 implements the root Widget.

func (*Application) Init

func (app *Application) Init()

Init initiatialises Application. Can be called multiple times.

func (*Application) Quit

func (app *Application) Quit()

Quit performs shotdown steps, overrides views.Application.Quit.

func (*Application) Resize

func (app *Application) Resize()

Resize implements the root Widget.

func (*Application) Run

func (app *Application) Run() (err error)

Run runs the application, overrides views.Application.Run.

func (*Application) SetView

func (app *Application) SetView(view views.View)

SetView implements the root Widget.

func (*Application) SongChange

func (app *Application) SongChange(song song.Song)

func (*Application) Start

func (app *Application) Start()

Start overrides views.Application.Start.

func (*Application) Unwatch

func (app *Application) Unwatch(handler tcell.EventHandler)

Unwatch implements the root Widget.

func (*Application) Watch

func (app *Application) Watch(handler tcell.EventHandler)

Watch implements the root Widget.

type LyricsWidget

type LyricsWidget struct {
	*views.TextArea
	// contains filtered or unexported fields
}

LyricsWidget is a Widget implementation.

func NewLyricsWidget

func NewLyricsWidget(app *Application) (ret *LyricsWidget)

NewLyricsWidget allocates new LyricsWidget.

func (*LyricsWidget) HandleEvent

func (w *LyricsWidget) HandleEvent(ev tcell.Event) bool

func (*LyricsWidget) Scroll

func (w *LyricsWidget) Scroll(d ScrollDirection)

Scroll in the direction represented by d.

func (*LyricsWidget) SetContent

func (w *LyricsWidget) SetContent(text string)

func (*LyricsWidget) SetLines

func (w *LyricsWidget) SetLines(lines []string)

func (*LyricsWidget) SetLyrics

func (w *LyricsWidget) SetLyrics(lyrics lyrics.Lyrics, i int)

SetLyrics sets a particular line i of lyrics to be displayed. Each call sets an AfterFunc for the next line that needs to be displayed, so this method only needs to be called when the lyrics change. If i is -1 it cancels the AfterFunc and queries the current time from the client.

func (*LyricsWidget) SetPaused

func (w *LyricsWidget) SetPaused(v bool)

func (*LyricsWidget) SetScroll

func (w *LyricsWidget) SetScroll(v bool)

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