Documentation
¶
Index ¶
- func JoinHorizontal(tiles ...*Tile)
- func JoinVertical(tiles ...*Tile)
- type Tile
- func (t *Tile) GetSize() (int, int)
- func (t *Tile) GetSubtile(name string) *Tile
- func (t *Tile) NewNamedSubtile(name string) *Tile
- func (t *Tile) NewStyle() lipgloss.Style
- func (t *Tile) NewSubtile() *Tile
- func (t *Tile) OnRecalculate(cb func())
- func (t *Tile) Recalculate()
- func (t *Tile) SetStyle(s lipgloss.Style) lipgloss.Style
- func (t *Tile) WithSize(w, h int) *Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinHorizontal ¶
func JoinHorizontal(tiles ...*Tile)
JoinHorizontal joins the specified tiles horizontally.
func JoinVertical ¶
func JoinVertical(tiles ...*Tile)
JoinVertical joins the specified tiles vertically.
Types ¶
type Tile ¶
type Tile struct {
// contains filtered or unexported fields
}
func (*Tile) GetSize ¶
GetSize returns the width and height of the tile and calculates them if necessary.
func (*Tile) GetSubtile ¶
GetSubtile returns the subtile by name.
func (*Tile) NewNamedSubtile ¶
NewNamedSubtile creates a new subtile with a name that can be used to refer to it later.
func (*Tile) NewSubtile ¶
NewSubtile creates a new subtile with a random unique name, use this if there's no need to refer to the tile later.
func (*Tile) OnRecalculate ¶
func (t *Tile) OnRecalculate(cb func())
OnRecalculate adds the specified callback function to the list of funcs that will be called on recalculation of the tile's size.
func (*Tile) Recalculate ¶
func (t *Tile) Recalculate()
Recalculate forces a recalculation of the tile's size and calls OnRecalculate callbacks. This effect is recursively propagated to all subtiles as well.