Documentation
¶
Index ¶
- Variables
- func BottomLeftRect(area uv.Rectangle, width, height int) uv.Rectangle
- func Button(t *styles.Styles, opts ButtonOpts) string
- func CenterRect(area uv.Rectangle, width, height int) uv.Rectangle
- func DialogTitle(t *styles.Styles, title string, width int, fromColor, toColor color.Color) string
- func HitButtonIndex(c *lipgloss.Compositor, x, y int) int
- func JoinScrollbar(t *styles.Styles, view string, height, contentSize, viewportSize, offset int) string
- func Scrollbar(s *styles.Styles, height, contentSize, viewportSize, offset int) string
- type ButtonOpts
- type CoalescedWheelMsg
- type Randomizer
- type UI
Constants ¶
This section is empty.
Variables ¶
var ReadyPlaceholders = Randomizer{
"Ready!",
"Ready...",
"Ready?",
"Ready for instructions",
}
ReadyPlaceholders is a randomizer for ready placeholders.
var WorkingPlaceholders = Randomizer{
"Working!",
"Working...",
"Brrrrr...",
"Prrrrrrrr...",
"Processing...",
"Thinking...",
}
WorkingPlaceholders is a randomizer for working placeholders.
Functions ¶
func BottomLeftRect ¶
BottomLeftRect returns a new [Rectangle] positioned at the bottom-left within the given area with the specified width and height.
func Button ¶
func Button(t *styles.Styles, opts ButtonOpts) string
Button creates a button with an underlined character and selection state.
func CenterRect ¶
CenterRect returns a new [Rectangle] centered within the given area with the specified width and height.
func DialogTitle ¶
DialogTitle renders a dialog title with a decorative line filling the remaining width. When the title alone exceeds the available width it is truncated with an ellipsis so it never wraps.
func HitButtonIndex ¶
func HitButtonIndex(c *lipgloss.Compositor, x, y int) int
HitButtonIndex checks a compositor for a button hit and returns the button index, or -1 if no button was hit.
Types ¶
type ButtonOpts ¶
type ButtonOpts struct {
// Text is the button label
Text string
// UnderlineIndex is the 0-based index of the character to underline (-1 for none)
UnderlineIndex int
// Selected indicates whether this button is currently selected
Selected bool
// Hovered indicates whether the mouse is hovering over the button
Hovered bool
// Inactive marks a button inside a prompt that is not in the active
// pane. It renders lighter than the plain blurred style so the
// choices stay legible while the chat has focus.
Inactive bool
// Padding inner horizontal padding defaults to 2 if this is 0
Padding int
}
ButtonOpts defines the configuration for a single button.
type CoalescedWheelMsg ¶
CoalescedWheelMsg is emitted by the input filter after collapsing many terminal wheel samples into one message. DeltaX and DeltaY carry the summed scroll magnitude so handlers can scroll proportionally.
type Randomizer ¶
type Randomizer []string
Randomizer is an interface for generating random strings.
func (Randomizer) Random ¶
func (r Randomizer) Random() string
Random returns a random string from the randomizer.
type UI ¶
type UI struct {
// Styles holds the theme styles for the UI.
Styles *styles.Styles
// Workspace holds the workspace configuration for the UI.
Workspace workspaces.Workspace
}
UI returns the default UI configurations.
func DefaultUI ¶
func DefaultUI(workspace workspaces.Workspace) *UI
DefaultUI returns the default UI configurations using the theme from config (or the default Charmtone theme if unset).