Documentation ¶
Index ¶
- type AddNewWidget
- type AddPage
- type DeletePage
- type DeleteWidget
- type DummyMsg
- type HeaderSizeMsg
- type IAMActivePage
- type Skeleton
- func (s *Skeleton) AddPage(key string, title string, page tea.Model) *Skeleton
- func (s *Skeleton) AddWidget(key string, value string) *Skeleton
- func (s *Skeleton) DeleteAllWidgets() *Skeleton
- func (s *Skeleton) DeletePage(key string) *Skeleton
- func (s *Skeleton) DeleteWidget(key string) *Skeleton
- func (s *Skeleton) GetActivePage() string
- func (s *Skeleton) GetBorderColor() string
- func (s *Skeleton) GetPagePosition() lipgloss.Position
- func (s *Skeleton) GetTerminalHeight() int
- func (s *Skeleton) GetTerminalViewport() *viewport.Model
- func (s *Skeleton) GetTerminalWidth() int
- func (s *Skeleton) GetWidgetBorderColor() string
- func (s *Skeleton) IAMActivePageCmd() tea.Cmd
- func (s *Skeleton) Init() tea.Cmd
- func (s *Skeleton) IsTabsLocked() bool
- func (s *Skeleton) Listen() tea.Cmd
- func (s *Skeleton) LockTabs() *Skeleton
- func (s *Skeleton) SetActivePage(key string) *Skeleton
- func (s *Skeleton) SetActiveTabBorderColor(color string) *Skeleton
- func (s *Skeleton) SetActiveTabTextColor(color string) *Skeleton
- func (s *Skeleton) SetBorderColor(color string) *Skeleton
- func (s *Skeleton) SetInactiveTabBorderColor(color string) *Skeleton
- func (s *Skeleton) SetInactiveTabTextColor(color string) *Skeleton
- func (s *Skeleton) SetPagePosition(position lipgloss.Position) *Skeleton
- func (s *Skeleton) SetTabLeftPadding(padding int) *Skeleton
- func (s *Skeleton) SetTabRightPadding(padding int) *Skeleton
- func (s *Skeleton) SetTerminalViewportHeight(height int)
- func (s *Skeleton) SetTerminalViewportWidth(width int)
- func (s *Skeleton) SetWidgetBorderColor(color string) *Skeleton
- func (s *Skeleton) SetWidgetLeftPadding(padding int) *Skeleton
- func (s *Skeleton) SetWidgetRightPadding(padding int) *Skeleton
- func (s *Skeleton) UnlockTabs() *Skeleton
- func (s *Skeleton) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (s *Skeleton) UpdatePageTitle(key string, title string) *Skeleton
- func (s *Skeleton) UpdateWidgetValue(key string, value string) *Skeleton
- func (s *Skeleton) View() string
- type UpdatePageTitle
- type UpdateWidgetContent
- type WidgetSizeMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddNewWidget ¶
type AddPage ¶
type AddPage struct { // Key is unique key of the page, it is used to identify the page Key string // Title is the title of the page, it is used to show the title on the header Title string // Page is the page model, it is used to show the content of the page Page tea.Model }
AddPage adds a new page to the Skeleton.
type DeletePage ¶
type DeletePage struct { // Key is unique key of the page, it is used to identify the page Key string }
DeletePage deletes the page by the given key.
type DeleteWidget ¶
type DeleteWidget struct {
Key string
}
type DummyMsg ¶
type DummyMsg struct{} // To trigger the update
DummyMsg is a dummy message to trigger the update. It used in fast operations that doesn't need to send a message.
type HeaderSizeMsg ¶
type HeaderSizeMsg struct {
NotEnoughToHandleHeaders bool
}
type IAMActivePage ¶
type IAMActivePage struct{}
IAMActivePage is a message to trigger the update of the active page.
type Skeleton ¶
type Skeleton struct { // KeyMap responsible for the key bindings KeyMap *keyMap // contains filtered or unexported fields }
Skeleton is a helper for rendering the Skeleton of the terminal.
func (*Skeleton) DeleteAllWidgets ¶
DeleteAllWidgets deletes all the widgets.
func (*Skeleton) DeletePage ¶
DeletePage deletes the page by the given key.
func (*Skeleton) DeleteWidget ¶
DeleteWidget deletes the Value by the given key.
func (*Skeleton) GetActivePage ¶
GetActivePage returns the active page key.
func (*Skeleton) GetBorderColor ¶
GetBorderColor returns the border color of the Skeleton.
func (*Skeleton) GetPagePosition ¶
GetPagePosition returns the position of the page.
func (*Skeleton) GetTerminalHeight ¶
GetTerminalHeight returns the height of the terminal.
func (*Skeleton) GetTerminalViewport ¶
GetTerminalViewport returns the viewport.
func (*Skeleton) GetTerminalWidth ¶
GetTerminalWidth returns the width of the terminal.
func (*Skeleton) GetWidgetBorderColor ¶
GetWidgetBorderColor returns the border color of the Widget.
func (*Skeleton) IAMActivePageCmd ¶
IAMActivePageCmd returns the IAMActivePage command.
func (*Skeleton) IsTabsLocked ¶
IsTabsLocked returns the tabs (headers) are locked or not.
func (*Skeleton) Listen ¶
Listen returns the update channel. It listens to the update channel and returns the message. If there is no message, it waits for the message.
func (*Skeleton) LockTabs ¶
LockTabs locks the tabs (headers). It prevents switching tabs. It is useful when you want to prevent switching tabs.
func (*Skeleton) SetActivePage ¶
SetActivePage sets the active page by the given key.
func (*Skeleton) SetActiveTabBorderColor ¶
SetActiveTabBorderColor sets the active tab border color of the Skeleton.
func (*Skeleton) SetActiveTabTextColor ¶
SetActiveTabTextColor sets the active tab color of the Skeleton.
func (*Skeleton) SetBorderColor ¶
SetBorderColor sets the border color of the Skeleton.
func (*Skeleton) SetInactiveTabBorderColor ¶
SetInactiveTabBorderColor sets the idle tab border color of the Skeleton.
func (*Skeleton) SetInactiveTabTextColor ¶
SetInactiveTabTextColor sets the idle tab color of the Skeleton.
func (*Skeleton) SetPagePosition ¶
SetPagePosition sets the position of the page.
func (*Skeleton) SetTabLeftPadding ¶
SetTabLeftPadding sets the left padding of the Skeleton.
func (*Skeleton) SetTabRightPadding ¶
SetTabRightPadding sets the right padding of the Skeleton.
func (*Skeleton) SetTerminalViewportHeight ¶
SetTerminalViewportHeight sets the height of the viewport.
func (*Skeleton) SetTerminalViewportWidth ¶
SetTerminalViewportWidth sets the width of the viewport.
func (*Skeleton) SetWidgetBorderColor ¶
SetWidgetBorderColor sets the border color of the Widget.
func (*Skeleton) SetWidgetLeftPadding ¶
SetWidgetLeftPadding sets the left padding of the Skeleton.
func (*Skeleton) SetWidgetRightPadding ¶
SetWidgetRightPadding sets the right padding of the Skeleton.
func (*Skeleton) UnlockTabs ¶
UnlockTabs unlocks the tabs (headers). It allows switching tabs. It is useful when you want to allow switching tabs.
func (*Skeleton) UpdatePageTitle ¶
UpdatePageTitle updates the title of the page by the given key.
func (*Skeleton) UpdateWidgetValue ¶
UpdateWidgetValue updates the Value content by the given key. Adds the widget if it doesn't exist.
type UpdatePageTitle ¶
type UpdatePageTitle struct { // Key is unique key of the page, it is used to identify the page Key string // Title is the title of the page, it is used to show the title on the header Title string }
UpdatePageTitle updates the title of the page by the given key.
type UpdateWidgetContent ¶
type WidgetSizeMsg ¶
type WidgetSizeMsg struct {
NotEnoughToHandleWidgets bool
}