Documentation
¶
Overview ¶
Package tabbar provides a horizontal tab bar for the TUI.
Index ¶
- type KeyMap
- type Tab
- type TabBar
- func (t *TabBar) Bindings() []key.Binding
- func (t *TabBar) Height() int
- func (t *TabBar) IsDragging() bool
- func (t *TabBar) SetAnimFrame(frame int)
- func (t *TabBar) SetTabs(tabs []messages.TabInfo, activeIdx int)
- func (t *TabBar) SetWidth(width int)
- func (t *TabBar) Update(msg tea.Msg) tea.Cmd
- func (t *TabBar) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMap ¶
type KeyMap struct {
NewTab key.Binding
NextTab key.Binding
PrevTab key.Binding
CloseTab key.Binding
}
KeyMap defines key bindings for the tab bar.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns the default tab bar key bindings.
type Tab ¶
type Tab struct {
// contains filtered or unexported fields
}
Tab represents a single rendered tab in the tab bar.
func (Tab) MainZoneEnd ¶
MainZoneEnd returns the X offset where the main click area ends and the close-button click area begins.
type TabBar ¶
type TabBar struct {
// contains filtered or unexported fields
}
TabBar renders a horizontal bar of session tabs with click and keyboard support.
func New ¶
New creates a new tab bar with the given max title length. If maxTitleLen is <= 0, the default (20) is used.
func (*TabBar) Height ¶
Height returns the height of the tab bar. Returns 0 when there is a single tab (no bar needed).
func (*TabBar) IsDragging ¶
IsDragging returns true when a tab drag is in progress.
func (*TabBar) SetAnimFrame ¶
SetAnimFrame updates the animation frame for the running indicator.