Documentation
¶
Index ¶
- Constants
- Variables
- func AppendContent(contents *[]string, text string, width int)
- func FillGap(height int) string
- func IconFallback(icon icon, fallback string) string
- func ScrollBar(windowHeight int, contentHeight int, scroll int) (height int, position int)
- func UpdateModel[T tea.Model](commands *[]tea.Cmd, model tea.Model, raw tea.Msg) T
- func WithIcon(icon icon, str string) string
- type Keybinds
- type Message
- type Notification
- type NotificationType
- type OverflowBottomMsg
- type OverflowTopMsg
Constants ¶
View Source
const ( GEAR_ICON icon = " " INFO_ICON icon = " " USER_ICON icon = " " PROFILE_ICON icon = " " PACKAGE_ICON icon = " " GAME_ICON icon = " " LIST_ICON icon = " " SAVE_ICON icon = " " HOME_ICON icon = " " NEW_USER_ICON icon = " " WARNING_ICON icon = " " LOADING_ICON icon = " " DELETE_ICON icon = " " STAR_ICON icon = " " )
https://www.nerdfonts.com/cheat-sheet
View Source
const FULL_HELP_HEIGHT = 4
Variables ¶
View Source
var GlobalKeybinds = Keybinds{ "scroll.up": key.NewBinding( key.WithKeys("K", "up"), key.WithHelp(" K/", "scroll up"), ), "scroll.down": key.NewBinding( key.WithKeys("J", "down"), key.WithHelp(" J/", "scroll down"), ), "goto.top": key.NewBinding( key.WithKeys("ctrl+u", "home"), key.WithHelp("^U/home", "go to top"), ), "goto.bottom": key.NewBinding( key.WithKeys("ctrl+d", "end"), key.WithHelp("^D/end", "go to bottom"), ), }
View Source
var HelpKeybind = key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "help"), )
View Source
var QuitKeybind = key.NewBinding( key.WithKeys("q", "ctrl+c"), key.WithHelp("q", "quit"), )
Functions ¶
func AppendContent ¶
Appends a text render with specified width
func IconFallback ¶
Returns an icon if --icons CLI flag is on, otherwise the fallback string
func UpdateModel ¶
A util function that calls the model.Update() method, appends the command, and maps the return value from tea.Model
Types ¶
type Notification ¶
type Notification struct { Type NotificationType Text string }
type NotificationType ¶
type NotificationType uint8
const ( HELP NotificationType = iota TASK ERROR )
type OverflowBottomMsg ¶
type OverflowBottomMsg struct{}
type OverflowTopMsg ¶
type OverflowTopMsg struct{}
Click to show internal directories.
Click to hide internal directories.