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) CanCloseTabWithKey() bool
- func (t *TabBar) CancelHover()
- func (t *TabBar) ClearHover()
- func (t *TabBar) Height() int
- func (t *TabBar) IsDragging() bool
- func (t *TabBar) SetCanSpawn(canSpawn bool)
- func (t *TabBar) SetHideSingle(hide bool)
- func (t *TabBar) SetMaxTitleLength(maxTitleLen int)
- func (t *TabBar) SetTabs(tabs []messages.TabInfo, activeIdx int)
- func (t *TabBar) SetWidth(width int)
- func (t *TabBar) TickHover(tick animation.TickMsg)
- func (t *TabBar) Update(msg tea.Msg) tea.Cmd
- func (t *TabBar) UpdateHover(x int) tea.Cmd
- func (t *TabBar) View() string
- func (t *TabBar) VisualGeneration() uint64
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) CanCloseTabWithKey ¶ added in v1.168.0
CanCloseTabWithKey reports whether the close shortcut applies.
func (*TabBar) CancelHover ¶ added in v1.168.0
func (t *TabBar) CancelHover()
CancelHover immediately resets all hover and click-pulse feedback when the strip loses visibility or focus.
func (*TabBar) ClearHover ¶ added in v1.168.0
func (t *TabBar) ClearHover()
ClearHover immediately resets pointer hover fades while letting an in-flight click pulse finish.
func (*TabBar) IsDragging ¶
IsDragging returns true when a tab drag is in progress.
func (*TabBar) SetCanSpawn ¶ added in v1.168.0
SetCanSpawn configures whether new tabs can be spawned (showing "+" and allowing the last remaining tab to be closed and replaced).
func (*TabBar) SetHideSingle ¶ added in v1.168.0
SetHideSingle controls whether a lone session needs a tab row.
func (*TabBar) SetMaxTitleLength ¶ added in v1.109.0
SetMaxTitleLength applies the title truncation limit immediately.
func (*TabBar) UpdateHover ¶ added in v1.168.0
UpdateHover handles tab-local pointer cells; a negative x leaves the strip.
func (*TabBar) VisualGeneration ¶ added in v1.118.0
VisualGeneration changes only when rendered tab geometry or drag styling changes.