Documentation
¶
Index ¶
- Constants
- func NewChocolateFlavour(opts ...ChocolateThemeOption) *chocolateFlavour
- type BarModel
- type BarViewer
- type Chocolate
- func (c *Chocolate) AddConstraints(constraints ...Constraint)
- func (c *Chocolate) AddModelBarModel(model BarModel, name string, bar string, flavoured bool, ...)
- func (c *Chocolate) AddRootThemeModifier(style FlavourStyleSelector, modifiers ...ThemeStyleModifier)
- func (c *Chocolate) AddStyledViewBarModel(model BarViewer, name string, bar string, style *lipgloss.Style)
- func (c *Chocolate) AddTeaModelBarModel(model tea.Model, name string, bar string, flavoured bool, ...)
- func (c *Chocolate) AddThemeModifier(name string, model string, style FlavourStyleSelector, ...)
- func (c *Chocolate) AddViewBarModel(model BarViewer, name string, bar string, flavoured bool, ...)
- func (c *Chocolate) FromFile(file string) error
- func (c *Chocolate) FromJson(layout []byte) error
- func (c *Chocolate) Hide(bar string)
- func (c *Chocolate) IsBar(bar string) bool
- func (c *Chocolate) IsHidden(bar string) bool
- func (c *Chocolate) MakeBar(name string, canhide bool) bool
- func (c *Chocolate) MakeChocolate(name string, bar string, flavoured bool, styles ...FlavourStyleSelector) *Chocolate
- func (c *Chocolate) MakeOverlay(name string, zindex int, width float64, height float64, flavoured bool, ...) *Overlay
- func (c *Chocolate) MakeStyledText(name string, bar string, style *lipgloss.Style) *TextModel
- func (c *Chocolate) MakeText(name string, bar string, flavoured bool, styles ...FlavourStyleSelector) *TextModel
- func (c *Chocolate) Resize(width, height int)
- func (c *Chocolate) SelectModel(name string, bar string)
- func (c *Chocolate) SelectRootStyle(name FlavourStyleSelector)
- func (c *Chocolate) SelectStyle(name FlavourStyleSelector, bar string)
- func (c *Chocolate) SetCanHide(bar string, v bool)
- func (t *Chocolate) SetDefault(style *lipgloss.Style)
- func (t *Chocolate) SetStyle(selector FlavourStyleSelector, style *lipgloss.Style)
- func (c *Chocolate) Unhide(bar string)
- func (c *Chocolate) View() string
- type ChocolateOption
- type ChocolateThemeOption
- type Constraint
- func (c *Constraint) UnmarshalJSON(data []byte) error
- func (c Constraint) WithConstant(v float64) Constraint
- func (c Constraint) WithMultiplier(v float64) Constraint
- func (c Constraint) WithRelation(v ConstraintRelation) Constraint
- func (c Constraint) WithSource(v string) Constraint
- func (c Constraint) WithSourceAttribute(v ConstraintAttribute) Constraint
- func (c Constraint) WithStrength(v ConstraintStrength) Constraint
- func (c Constraint) WithTarget(v string) Constraint
- func (c Constraint) WithTargetAttribute(v ConstraintAttribute) Constraint
- type ConstraintAttribute
- type ConstraintRelation
- type ConstraintStrength
- type FlavourStyleSelector
- type KeyMap
- type Overlay
- func (o *Overlay) Disable()
- func (o *Overlay) Enable()
- func (o *Overlay) Resize(width, height int)
- func (t *Overlay) SetDefault(style *lipgloss.Style)
- func (o *Overlay) SetPosition(pos ...OverlayPosition)
- func (t *Overlay) SetStyle(selector FlavourStyleSelector, style *lipgloss.Style)
- func (o *Overlay) SetZIndex(v int)
- type OverlayPosition
- type TextModel
- type ThemeStyleModifier
- func Align(p ...lipgloss.Position) ThemeStyleModifier
- func AlignHorizontal(p lipgloss.Position) ThemeStyleModifier
- func AlignVertical(p lipgloss.Position) ThemeStyleModifier
- func Background(c lipgloss.TerminalColor) ThemeStyleModifier
- func Blink(v bool) ThemeStyleModifier
- func Border(b lipgloss.Border, sides ...bool) ThemeStyleModifier
- func BorderBackground(c ...lipgloss.TerminalColor) ThemeStyleModifier
- func BorderBottom(v bool) ThemeStyleModifier
- func BorderBottomBackground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderBottomForeground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderForeground(c ...lipgloss.TerminalColor) ThemeStyleModifier
- func BorderLeft(v bool) ThemeStyleModifier
- func BorderLeftBackground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderLeftForeground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderRight(v bool) ThemeStyleModifier
- func BorderRightBackground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderRightForeground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderStyle(b lipgloss.Border) ThemeStyleModifier
- func BorderTop(v bool) ThemeStyleModifier
- func BorderTopBackground(c lipgloss.TerminalColor) ThemeStyleModifier
- func BorderTopForeground(c lipgloss.TerminalColor) ThemeStyleModifier
- func Faint(v bool) ThemeStyleModifier
- func Foreground(c lipgloss.TerminalColor) ThemeStyleModifier
- func Italic(v bool) ThemeStyleModifier
- func Margin(i ...int) ThemeStyleModifier
- func MarginBackground(c lipgloss.TerminalColor) ThemeStyleModifier
- func MarginBottom(i int) ThemeStyleModifier
- func MarginLeft(i int) ThemeStyleModifier
- func MarginRight(i int) ThemeStyleModifier
- func MarginTop(i int) ThemeStyleModifier
- func Padding(i ...int) ThemeStyleModifier
- func PaddingBottom(i int) ThemeStyleModifier
- func PaddingLeft(i int) ThemeStyleModifier
- func PaddingRight(i int) ThemeStyleModifier
- func PaddingTor(i int) ThemeStyleModifier
- func Reverse(v bool) ThemeStyleModifier
Constants ¶
View Source
const ( WEAK ConstraintStrength = ConstraintStrength(casso.Weak) MEDIUM = ConstraintStrength(casso.Medium) STRONG = ConstraintStrength(casso.Strong) REQUIRED = ConstraintStrength(casso.Required) )
Variables ¶
This section is empty.
Functions ¶
func NewChocolateFlavour ¶
func NewChocolateFlavour(opts ...ChocolateThemeOption) *chocolateFlavour
Types ¶
type Chocolate ¶
type Chocolate struct {
// contains filtered or unexported fields
}
func NewChocolate ¶
func NewChocolate(opts ...ChocolateOption) *Chocolate
func (*Chocolate) AddConstraints ¶
func (c *Chocolate) AddConstraints(constraints ...Constraint)
func (*Chocolate) AddModelBarModel ¶
func (*Chocolate) AddRootThemeModifier ¶
func (c *Chocolate) AddRootThemeModifier(style FlavourStyleSelector, modifiers ...ThemeStyleModifier)
func (*Chocolate) AddStyledViewBarModel ¶
func (*Chocolate) AddTeaModelBarModel ¶
func (*Chocolate) AddThemeModifier ¶
func (c *Chocolate) AddThemeModifier(name string, model string, style FlavourStyleSelector, modifiers ...ThemeStyleModifier)
func (*Chocolate) AddViewBarModel ¶
func (*Chocolate) MakeChocolate ¶
func (*Chocolate) MakeOverlay ¶
func (*Chocolate) MakeStyledText ¶
func (*Chocolate) SelectModel ¶
func (*Chocolate) SelectRootStyle ¶
func (c *Chocolate) SelectRootStyle(name FlavourStyleSelector)
func (*Chocolate) SelectStyle ¶
func (c *Chocolate) SelectStyle(name FlavourStyleSelector, bar string)
func (*Chocolate) SetCanHide ¶
func (*Chocolate) SetDefault ¶
func (*Chocolate) SetStyle ¶
func (t *Chocolate) SetStyle(selector FlavourStyleSelector, style *lipgloss.Style)
type ChocolateOption ¶
type ChocolateOption func(*Chocolate)
func WithFlavour ¶
func WithFlavour(flavour *chocolateFlavour) ChocolateOption
type ChocolateThemeOption ¶
type ChocolateThemeOption func(*chocolateFlavour)
func DefaultStyle ¶
func DefaultStyle(style *lipgloss.Style) ChocolateThemeOption
func WithDefaults ¶
func WithDefaults(s ...*lipgloss.Style) ChocolateThemeOption
type Constraint ¶
type Constraint struct {
Target string `json:"target"`
Source string `json:"source"`
TargetAttribute ConstraintAttribute `json:"target_attribute"`
SourceAttribute ConstraintAttribute `json:"source_attribute"`
Relation ConstraintRelation `json:"relation"`
Constant float64 `json:"constant"`
Multiplier float64 `json:"multiplier"`
Strength ConstraintStrength `json:"strength"`
}
func NewConstraint ¶
func NewConstraint() Constraint
func (*Constraint) UnmarshalJSON ¶
func (c *Constraint) UnmarshalJSON(data []byte) error
func (Constraint) WithConstant ¶
func (c Constraint) WithConstant(v float64) Constraint
func (Constraint) WithMultiplier ¶
func (c Constraint) WithMultiplier(v float64) Constraint
func (Constraint) WithRelation ¶
func (c Constraint) WithRelation(v ConstraintRelation) Constraint
func (Constraint) WithSource ¶
func (c Constraint) WithSource(v string) Constraint
func (Constraint) WithSourceAttribute ¶
func (c Constraint) WithSourceAttribute(v ConstraintAttribute) Constraint
func (Constraint) WithStrength ¶
func (c Constraint) WithStrength(v ConstraintStrength) Constraint
func (Constraint) WithTarget ¶
func (c Constraint) WithTarget(v string) Constraint
func (Constraint) WithTargetAttribute ¶
func (c Constraint) WithTargetAttribute(v ConstraintAttribute) Constraint
type ConstraintAttribute ¶
type ConstraintAttribute uint8
const ( WIDTH ConstraintAttribute = iota HEIGHT XSTART YSTART XEND YEND )
func (*ConstraintAttribute) UnmarshalJSON ¶
func (ca *ConstraintAttribute) UnmarshalJSON(data []byte) error
type ConstraintRelation ¶
type ConstraintRelation uint8
const ( EQ ConstraintRelation = ConstraintRelation(casso.EQ) GE ConstraintRelation = ConstraintRelation(casso.GTE) LE ConstraintRelation = ConstraintRelation(casso.LTE) )
func (*ConstraintRelation) UnmarshalJSON ¶
func (cr *ConstraintRelation) UnmarshalJSON(data []byte) error
type ConstraintStrength ¶
type ConstraintStrength float64
func (*ConstraintStrength) UnmarshalJSON ¶
func (cs *ConstraintStrength) UnmarshalJSON(data []byte) error
type FlavourStyleSelector ¶
type FlavourStyleSelector string
const ( TS_DEFAULT FlavourStyleSelector = "default" TS_SELECTED FlavourStyleSelector = "selected" TS_FOCUSED FlavourStyleSelector = "focused" )
type KeyMap ¶
type KeyMap struct {
// Keybindings used when selecting models.
Next key.Binding
Prev key.Binding
Select key.Binding
Leave key.Binding
// Quitting
Quit key.Binding
// Help toggle keybindings.
ShowFullHelp key.Binding
CloseFullHelp key.Binding
}
KeyMap defines keybindings. It satisfies to the help.KeyMap interface, which is used to render the menu.
func DefaultKeyMap ¶
func DefaultKeyMap() *KeyMap
DefaultKeyMap returns a default set of keybindings.
type Overlay ¶
type Overlay struct {
Chocolate
// contains filtered or unexported fields
}
func (*Overlay) SetDefault ¶
func (*Overlay) SetPosition ¶
func (o *Overlay) SetPosition(pos ...OverlayPosition)
func (*Overlay) SetStyle ¶
func (t *Overlay) SetStyle(selector FlavourStyleSelector, style *lipgloss.Style)
type ThemeStyleModifier ¶
func Align ¶
func Align(p ...lipgloss.Position) ThemeStyleModifier
func AlignHorizontal ¶
func AlignHorizontal(p lipgloss.Position) ThemeStyleModifier
func AlignVertical ¶
func AlignVertical(p lipgloss.Position) ThemeStyleModifier
func Background ¶
func Background(c lipgloss.TerminalColor) ThemeStyleModifier
func Blink ¶
func Blink(v bool) ThemeStyleModifier
func BorderBackground ¶
func BorderBackground(c ...lipgloss.TerminalColor) ThemeStyleModifier
func BorderBottom ¶
func BorderBottom(v bool) ThemeStyleModifier
func BorderBottomBackground ¶
func BorderBottomBackground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderBottomForeground ¶
func BorderBottomForeground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderForeground ¶
func BorderForeground(c ...lipgloss.TerminalColor) ThemeStyleModifier
func BorderLeft ¶
func BorderLeft(v bool) ThemeStyleModifier
func BorderLeftBackground ¶
func BorderLeftBackground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderLeftForeground ¶
func BorderLeftForeground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderRight ¶
func BorderRight(v bool) ThemeStyleModifier
func BorderRightBackground ¶
func BorderRightBackground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderRightForeground ¶
func BorderRightForeground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderStyle ¶
func BorderStyle(b lipgloss.Border) ThemeStyleModifier
func BorderTop ¶
func BorderTop(v bool) ThemeStyleModifier
func BorderTopBackground ¶
func BorderTopBackground(c lipgloss.TerminalColor) ThemeStyleModifier
func BorderTopForeground ¶
func BorderTopForeground(c lipgloss.TerminalColor) ThemeStyleModifier
func Faint ¶
func Faint(v bool) ThemeStyleModifier
func Foreground ¶
func Foreground(c lipgloss.TerminalColor) ThemeStyleModifier
func Italic ¶
func Italic(v bool) ThemeStyleModifier
func Margin ¶
func Margin(i ...int) ThemeStyleModifier
func MarginBackground ¶
func MarginBackground(c lipgloss.TerminalColor) ThemeStyleModifier
func MarginBottom ¶
func MarginBottom(i int) ThemeStyleModifier
func MarginLeft ¶
func MarginLeft(i int) ThemeStyleModifier
func MarginRight ¶
func MarginRight(i int) ThemeStyleModifier
func MarginTop ¶
func MarginTop(i int) ThemeStyleModifier
func Padding ¶
func Padding(i ...int) ThemeStyleModifier
func PaddingBottom ¶
func PaddingBottom(i int) ThemeStyleModifier
func PaddingLeft ¶
func PaddingLeft(i int) ThemeStyleModifier
func PaddingRight ¶
func PaddingRight(i int) ThemeStyleModifier
func PaddingTor ¶
func PaddingTor(i int) ThemeStyleModifier
func Reverse ¶
func Reverse(v bool) ThemeStyleModifier
Source Files
¶
Click to show internal directories.
Click to hide internal directories.