Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultBorderWithPadding(box *tview.Box)
- func DefaultBorderWithoutPadding(box *tview.Box)
- func SetPanelTitle(box *tview.Box, title string)
- func WithSeparator(separator string) func(bc *Breadcrumbs)
- type Breadcrumb
- type Breadcrumbs
- func (b *Breadcrumbs) Blur()
- func (b *Breadcrumbs) Clear()
- func (b *Breadcrumbs) Draw(screen tcell.Screen)
- func (b *Breadcrumbs) Focus(delegate func(p tview.Primitive))
- func (b *Breadcrumbs) GoHome() error
- func (b *Breadcrumbs) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (b *Breadcrumbs) IsLastItemSelected() bool
- func (b *Breadcrumbs) ItemsCount() int
- func (b *Breadcrumbs) MouseHandler() ...
- func (b *Breadcrumbs) Push(item Breadcrumb)
- func (b *Breadcrumbs) SelectedItemIndex() int
- func (b *Breadcrumbs) SetNextFocusTarget(p tview.Primitive) *Breadcrumbs
- func (b *Breadcrumbs) SetPrevFocusTarget(p tview.Primitive) *Breadcrumbs
- func (b *Breadcrumbs) TakeFocus()
- type ButtonWithShortcut
- type PrimitiveWithBox
- type Tab
- type TabStyles
- type Tabs
- type TabsOption
- type TabsStyle
- type WithBoxType
- func PaddedBox[T tview.Primitive](content T, title string, ...) WithBoxType[*tview.Flex]
- func WithBordersWithoutPadding[T tview.Primitive](p T, box *tview.Box) WithBoxType[T]
- func WithBoxWithoutBorder[T tview.Primitive](p T, box *tview.Box) WithBoxType[T]
- func WithDefaultBorders[T tview.Primitive](p T, box *tview.Box) WithBoxType[T]
Constants ¶
View Source
const DefaultBlurBorderColor = tcell.ColorGray
View Source
const DefaultFocusedBorderColor = tcell.ColorCornflowerBlue
Variables ¶
View Source
var RadioTabsStyle = TabsStyle{ Radio: true, Underscore: false, ActiveFocused: TabStyles{ Foreground: "white", Background: "black", }, ActiveBlur: TabStyles{ Foreground: "lightgray", Background: "black", }, InactiveFocused: TabStyles{ Foreground: "lightgray", Background: "black", }, }
View Source
var UnderlineTabsStyle = TabsStyle{ Radio: false, Underscore: true, ActiveFocused: TabStyles{ Foreground: "black", Background: "lightgray", }, ActiveBlur: TabStyles{ Foreground: "black", Background: "darkgray", }, InactiveFocused: TabStyles{ Foreground: "lightgray", Background: "black", }, InactiveBlur: TabStyles{ Foreground: "gray", Background: "black", }, }
Functions ¶
func SetPanelTitle ¶
func WithSeparator ¶
func WithSeparator(separator string) func(bc *Breadcrumbs)
Types ¶
type Breadcrumb ¶
func NewBreadcrumb ¶
func NewBreadcrumb(title string, action func() error) Breadcrumb
type Breadcrumbs ¶
func NewBreadcrumbs ¶
func NewBreadcrumbs(root Breadcrumb, options ...func(bc *Breadcrumbs)) *Breadcrumbs
func (*Breadcrumbs) Blur ¶
func (b *Breadcrumbs) Blur()
Blur is called when this primitive loses focus.
func (*Breadcrumbs) Clear ¶
func (b *Breadcrumbs) Clear()
func (*Breadcrumbs) Draw ¶
func (b *Breadcrumbs) Draw(screen tcell.Screen)
func (*Breadcrumbs) Focus ¶
func (b *Breadcrumbs) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*Breadcrumbs) GoHome ¶
func (b *Breadcrumbs) GoHome() error
func (*Breadcrumbs) InputHandler ¶
func (b *Breadcrumbs) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler handles keyboard input for navigation and activation.
func (*Breadcrumbs) IsLastItemSelected ¶
func (b *Breadcrumbs) IsLastItemSelected() bool
func (*Breadcrumbs) ItemsCount ¶
func (b *Breadcrumbs) ItemsCount() int
func (*Breadcrumbs) MouseHandler ¶
func (b *Breadcrumbs) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler handles selection via mouse and focusing on click.
func (*Breadcrumbs) Push ¶
func (b *Breadcrumbs) Push(item Breadcrumb)
func (*Breadcrumbs) SelectedItemIndex ¶
func (b *Breadcrumbs) SelectedItemIndex() int
func (*Breadcrumbs) SetNextFocusTarget ¶
func (b *Breadcrumbs) SetNextFocusTarget(p tview.Primitive) *Breadcrumbs
SetNextFocusTarget sets the primitive to focus when Tab/Down is pressed.
func (*Breadcrumbs) SetPrevFocusTarget ¶
func (b *Breadcrumbs) SetPrevFocusTarget(p tview.Primitive) *Breadcrumbs
SetPrevFocusTarget sets the primitive to focus when Shift+Tab/Up is pressed.
func (*Breadcrumbs) TakeFocus ¶
func (b *Breadcrumbs) TakeFocus()
type ButtonWithShortcut ¶
func NewButtonWithShortcut ¶
func NewButtonWithShortcut(label string, shortcut rune) *ButtonWithShortcut
func (*ButtonWithShortcut) Draw ¶
func (b *ButtonWithShortcut) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*ButtonWithShortcut) SetShortcutStyle ¶
func (b *ButtonWithShortcut) SetShortcutStyle(style tcell.Style) *ButtonWithShortcut
type Tabs ¶
type Tabs struct {
*tview.Flex
TabsStyle
TextView *tview.TextView // TODO(help-wanted): exported as a workaround to set focus - needs fix!
// contains filtered or unexported fields
}
Tabs is a tab container implemented using tview.Pages.
func NewTabs ¶
func NewTabs(app *tview.Application, style TabsStyle, options ...TabsOption) *Tabs
NewTabs creates a new tab container.
type TabsOption ¶
type TabsOption func(*tabsOptions)
func FocusDown ¶
func FocusDown(f func(current tview.Primitive)) TabsOption
func FocusLeft ¶
func FocusLeft(f func(current tview.Primitive)) TabsOption
func FocusUp ¶
func FocusUp(f func(current tview.Primitive)) TabsOption
func WithLabel ¶
func WithLabel(label string) TabsOption
type WithBoxType ¶
func PaddedBox ¶
func PaddedBox[T tview.Primitive]( content T, title string, paddingTop, paddingBottom, paddingLeft, paddingRight int, ) WithBoxType[*tview.Flex]
PaddedBox wraps a primitive with a border and padding. Padding is real layout padding (via Flex), not Box border padding.
func WithBordersWithoutPadding ¶
func WithBordersWithoutPadding[T tview.Primitive](p T, box *tview.Box) WithBoxType[T]
func WithBoxWithoutBorder ¶
func WithBoxWithoutBorder[T tview.Primitive](p T, box *tview.Box) WithBoxType[T]
func WithDefaultBorders ¶
func WithDefaultBorders[T tview.Primitive](p T, box *tview.Box) WithBoxType[T]
func (WithBoxType[T]) GetBox ¶
func (p WithBoxType[T]) GetBox() *tview.Box
func (WithBoxType[T]) GetPrimitive ¶
func (p WithBoxType[T]) GetPrimitive() T
Click to show internal directories.
Click to hide internal directories.