Documentation ¶
Index ¶
- Constants
- func ColumnTitle(key string) string
- type Application
- func (app *Application) Draw()
- func (app *Application) Events() <-chan tcell.Event
- func (app *Application) Finish()
- func (app *Application) HandleEvent(ev tcell.Event) bool
- func (app *Application) Init()
- func (app *Application) Poll()
- func (app *Application) Refresh()
- func (app *Application) Resize()
- func (app *Application) TableWidget() api.TableWidget
- type Multibar
- type Table
- func (w *Table) ColumnNames() []string
- func (w *Table) Draw()
- func (w *Table) GetVisibleBoundaries() (ymin, ymax int)
- func (w *Table) HandleEvent(_ tcell.Event) bool
- func (w *Table) Height() int
- func (w *Table) List() list.List
- func (w *Table) Name() string
- func (w *Table) PositionLongReadout() string
- func (w *Table) PositionReadout() string
- func (w *Table) PositionShortReadout() string
- func (w *Table) Resize()
- func (w *Table) ScrollViewport(delta int, movecursor bool)
- func (w *Table) SetColumns(tags []string)
- func (w *Table) SetList(lst list.List)
- func (w *Table) SetView(v views.View)
- func (w *Table) Size() (int, int)
- func (w *Table) Width() int
- type Topbar
Constants ¶
const ( AlignLeft = iota AlignCenter AlignRight )
Pieces may be aligned to left, center or right.
Variables ¶
This section is empty.
Functions ¶
func ColumnTitle ¶
Types ¶
type Application ¶
func NewApplication ¶
func NewApplication(a api.API) (*Application, error)
func (*Application) Draw ¶
func (app *Application) Draw()
func (*Application) Events ¶
func (app *Application) Events() <-chan tcell.Event
func (*Application) Finish ¶
func (app *Application) Finish()
func (*Application) HandleEvent ¶
func (app *Application) HandleEvent(ev tcell.Event) bool
func (*Application) Init ¶
func (app *Application) Init()
func (*Application) Poll ¶
func (app *Application) Poll()
func (*Application) Refresh ¶
func (app *Application) Refresh()
func (*Application) Resize ¶
func (app *Application) Resize()
func (*Application) TableWidget ¶
func (app *Application) TableWidget() api.TableWidget
type Multibar ¶
type Multibar struct { views.WidgetWatchers style.Styled // contains filtered or unexported fields }
Multibar receives keyboard events, displays status messages, and the position readout.
func NewMultibarWidget ¶
func (*Multibar) HandleEvent ¶
type Table ¶
type Table struct { style.Styled views.WidgetWatchers // contains filtered or unexported fields }
Table is a tcell widget which draws a gridded table from a List instance.
func (*Table) ColumnNames ¶
ColumnNames returns a list of the visible columns
func (*Table) GetVisibleBoundaries ¶
func (*Table) HandleEvent ¶
func (*Table) PositionLongReadout ¶
PositionLongReadout returns a formatted string containing the visible song range as well as the total number of songs. FIXME: move this into a positionreadout fragment
func (*Table) PositionReadout ¶
PositionReadout returns a combination of PositionLongReadout() and PositionShortReadout(). FIXME: move this into a positionreadout fragment
func (*Table) PositionShortReadout ¶
PositionShortReadout returns a percentage indicator on how far the songlist is scrolled. FIXME: move this into a positionreadout fragment
func (*Table) ScrollViewport ¶
ScrollViewport scrolls the viewport by delta rows, as far as possible. If movecursor is false, the cursor is kept pointing at the same song where possible. If true, the cursor is moved delta rows.
func (*Table) SetColumns ¶
SetColumns sets which columns that should be visible, and adjusts the sizes so they fit as close as possible to the median size of the content displayed.
type Topbar ¶
type Topbar struct { style.Styled views.WidgetWatchers // contains filtered or unexported fields }
Topbar is a widget that can display a variety of information, such as the currently playing song. It is composed of several pieces to form a two-dimensional matrix.
func (*Topbar) Draw ¶
func (w *Topbar) Draw()
Draw draws all the pieces in the matrix, from top to bottom, right to left.
func (*Topbar) HandleEvent ¶
func (*Topbar) SetMatrix ¶
func (w *Topbar) SetMatrix(matrix *topbar.MatrixStatement)
Setup sets up the topbar using the provided configuration string.