Documentation
¶
Index ¶
- Constants
- Variables
- func AccentTintColor() color.Color
- func CreateMonochromeImage(colorMode ebiten.ColorMode, img image.Image) image.Image
- func DangerTintColor() color.Color
- func FontSize(context *guigui.Context) float64
- func InfoTintColor() color.Color
- func LineHeight(context *guigui.Context) int
- func ListItemIndentSize(context *guigui.Context, level int) int
- func ListItemTextPadding(context *guigui.Context) guigui.Padding
- func MoveItemsInSlice[T any](slice []T, from int, count int, to int) int
- func RegisterFaceSourceEntries(add func(*guigui.Context, *FaceSourceEntryAdder))
- func RoundedCornerRadius(context *guigui.Context) int
- func SuccessTintColor() color.Color
- func TextColorFromTint(context *guigui.Context, tint color.Color) color.Color
- func TooltipTextPadding(context *guigui.Context) guigui.Padding
- func UnitSize(context *guigui.Context) int
- func WarningTintColor() color.Color
- type Background
- type Button
- func (b *Button) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (b *Button) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (b *Button) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (b *Button) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (b *Button) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (b *Button) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (b *Button) OnDown(f func(context *guigui.Context))
- func (b *Button) OnUp(f func(context *guigui.Context))
- func (b *Button) SetContent(content guigui.Widget)
- func (b *Button) SetIcon(icon *ebiten.Image)
- func (b *Button) SetIconAlign(align IconAlign)
- func (b *Button) SetPressed(pressed bool)
- func (b *Button) SetSharpCorners(sharpCorners Corners)
- func (b *Button) SetText(text string)
- func (b *Button) SetTextBold(bold bool)
- func (b *Button) SetTintColor(tint color.Color)
- func (b *Button) SetToggleable(toggleable bool)
- func (b *Button) SetType(typ ButtonType)
- func (b *Button) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (b *Button) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type ButtonType
- type Checkbox
- func (c *Checkbox) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (c *Checkbox) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (c *Checkbox) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (c *Checkbox) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (c *Checkbox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (c *Checkbox) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (c *Checkbox) OnValueChanged(f func(context *guigui.Context, value bool))
- func (c *Checkbox) SetValue(value bool)
- func (c *Checkbox) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (c *Checkbox) Value() bool
- func (c *Checkbox) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type Combobox
- func (c *Combobox) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (c *Combobox) IsError() bool
- func (c *Combobox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (c *Combobox) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (c *Combobox) OnValueChanged(f func(context *guigui.Context, value string, committed bool))
- func (c *Combobox) SetAllowFreeInput(allow bool)
- func (c *Combobox) SetError(hasError bool)
- func (c *Combobox) SetItems(items []string)
- func (c *Combobox) SetSupportText(text string)
- func (c *Combobox) SetValue(value string)
- func (c *Combobox) SupportText() string
- func (c *Combobox) TextInput() *TextInput
- func (c *Combobox) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (c *Combobox) Value() string
- type ContextMenuArea
- func (c *ContextMenuArea[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (c *ContextMenuArea[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (c *ContextMenuArea[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (c *ContextMenuArea[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (c *ContextMenuArea[T]) PopupMenu() *PopupMenu[T]
- type Corners
- type Divider
- type Drawer
- func (d *Drawer) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (d *Drawer) IsOpen() bool
- func (d *Drawer) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (d *Drawer) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (d *Drawer) OnClose(onClose func(context *guigui.Context, reason PopupCloseReason))
- func (d *Drawer) SetAnimated(animateOnFading bool)
- func (d *Drawer) SetBackgroundBlurred(blurred bool)
- func (d *Drawer) SetBackgroundBounds(bounds image.Rectangle)
- func (d *Drawer) SetBackgroundDark(dark bool)
- func (d *Drawer) SetCloseByClickingOutside(closeByClickingOutside bool)
- func (d *Drawer) SetContent(widget guigui.Widget)
- func (d *Drawer) SetDrawerEdge(edge DrawerEdge)
- func (d *Drawer) SetOpen(open bool)
- func (d *Drawer) SetTintColor(tint color.Color)
- type DrawerEdge
- type Expander
- func (e *Expander) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (e *Expander) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (e *Expander) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (e *Expander) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (e *Expander) OnExpansionChanged(callback func(context *guigui.Context, expanded bool))
- func (e *Expander) SetContentWidget(w guigui.Widget)
- func (e *Expander) SetExpanded(expanded bool)
- func (e *Expander) SetHeaderWidget(w guigui.Widget)
- func (e *Expander) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (e *Expander) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type FaceSourceEntry
- type FaceSourceEntryAdder
- type FaceSourceEntryPriority
- type FontFamily
- type FontFamilyOptions
- type Form
- func (f *Form) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (f *Form) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (f *Form) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (f *Form) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (f *Form) SetItems(items []FormItem)
- type FormItem
- type HorizontalAlign
- type IconAlign
- type Image
- func (i *Image) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (i *Image) HasImage() bool
- func (i *Image) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (i *Image) SetImage(image *ebiten.Image)
- func (i *Image) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type ItemTextStyle
- type LineHeightMode
- type List
- func (l *List[T]) AppendSelectedItemIndices(indices []int) []int
- func (l *List[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (l *List[T]) EnsureItemVisibleByIndex(index int)
- func (l *List[T]) ForceEnsureItemVisibleByIndex(index int)
- func (l *List[T]) ForceSetScrollPosition(position ListScrollPosition)
- func (l *List[T]) ID(index int) any
- func (l *List[T]) IndexByValue(value T) int
- func (l *List[T]) IsItemAvailable(index int) bool
- func (l *List[T]) IsItemInViewport(index int) bool
- func (l *List[T]) ItemBounds(index int) image.Rectangle
- func (l *List[T]) ItemByIndex(index int) (ListItem[T], bool)
- func (l *List[T]) ItemCount() int
- func (l *List[T]) JumpToItemByIndex(index int)
- func (l *List[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (l *List[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (l *List[T]) OnItemExpanderToggled(f func(context *guigui.Context, index int, expanded bool))
- func (l *List[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (l *List[T]) OnItemsCanMove(f func(context *guigui.Context, from, count, to int) bool)
- func (l *List[T]) OnItemsMoved(f func(context *guigui.Context, from, count, to int))
- func (l *List[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))
- func (l *List[T]) OnScroll(callback func(context *guigui.Context, position ListScrollPosition))
- func (l *List[T]) ScrollPosition() ListScrollPosition
- func (l *List[T]) SelectAllItems()
- func (l *List[T]) SelectItemByIndex(index int)
- func (l *List[T]) SelectItemByValue(value T)
- func (l *List[T]) SelectItemsByIndices(indices []int)
- func (l *List[T]) SelectItemsByValues(values []T)
- func (l *List[T]) SelectedItem() (ListItem[T], bool)
- func (l *List[T]) SelectedItemCount() int
- func (l *List[T]) SelectedItemIndex() int
- func (l *List[T]) SetBackground(widget guigui.Widget)
- func (l *List[T]) SetBackgroundStyle(style ListBackgroundStyle)
- func (l *List[T]) SetCornerRounded(rounded bool)
- func (l *List[T]) SetFooterHeight(height int)
- func (l *List[T]) SetFrameVisible(visible bool)
- func (l *List[T]) SetHeaderHeight(height int)
- func (l *List[T]) SetHighlightStyle(style ListItemHighlightStyle)
- func (l *List[T]) SetHighlightVisibleWhenUnfocused(visible bool)
- func (l *List[T]) SetHoverBackgroundVisible(visible bool)
- func (l *List[T]) SetItemHeight(height int)
- func (l *List[T]) SetItemString(str string, index int)
- func (l *List[T]) SetItems(items []ListItem[T])
- func (l *List[T]) SetItemsByStrings(strs []string)
- func (l *List[T]) SetMultiSelection(multi bool)
- func (l *List[T]) SetReservesCheckmarkSpace(reserves bool)
- func (l *List[T]) SetScrollPosition(position ListScrollPosition)
- func (l *List[T]) SetSelectedItemBold(bold bool)
- func (l *List[T]) SetStripeVisible(visible bool)
- func (l *List[T]) SetStyle(style ListStyle)
- func (l *List[T]) SetUnfocusedSelectionVisible(visible bool)
- func (l *List[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (l *List[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type ListBackgroundStyle
- type ListItem
- type ListItemColorType
- type ListItemHighlightStyle
- type ListScrollPosition
- type ListStyle
- type Menubar
- func (m *Menubar[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (m *Menubar[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (m *Menubar[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (m *Menubar[T]) OnItemSelected(f func(context *guigui.Context, menuIndex, itemIndex int))
- func (m *Menubar[T]) PopupMenuAt(index int) *PopupMenu[T]
- func (m *Menubar[T]) SetItems(items []MenubarItem)
- func (m *Menubar[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type MenubarItem
- type NumberInput
- func (n *NumberInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (n *NumberInput) CanCopy() bool
- func (n *NumberInput) CanCut() bool
- func (n *NumberInput) CanPaste() bool
- func (n *NumberInput) CommitWithCurrentInputValue()
- func (n *NumberInput) Copy() bool
- func (n *NumberInput) Cut() bool
- func (n *NumberInput) ForceSetValue(value int)
- func (n *NumberInput) ForceSetValueBigInt(value *big.Int)
- func (n *NumberInput) ForceSetValueInt64(value int64)
- func (n *NumberInput) ForceSetValueUint64(value uint64)
- func (n *NumberInput) IsEditable() bool
- func (n *NumberInput) IsError() bool
- func (n *NumberInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (n *NumberInput) MaximumValueBigInt() *big.Int
- func (n *NumberInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (n *NumberInput) MinimumValueBigInt() *big.Int
- func (n *NumberInput) OnHandleButtonInput(...)
- func (n *NumberInput) OnValueChanged(f func(context *guigui.Context, value int, committed bool))
- func (n *NumberInput) OnValueChangedBigInt(f func(context *guigui.Context, value *big.Int, committed bool))
- func (n *NumberInput) OnValueChangedInt64(f func(context *guigui.Context, value int64, committed bool))
- func (n *NumberInput) OnValueChangedUint64(f func(context *guigui.Context, value uint64, committed bool))
- func (n *NumberInput) Paste() bool
- func (n *NumberInput) SetEditable(editable bool)
- func (n *NumberInput) SetError(hasError bool)
- func (n *NumberInput) SetMaximumValue(maximum int)
- func (n *NumberInput) SetMaximumValueBigInt(maximum *big.Int)
- func (n *NumberInput) SetMaximumValueInt64(maximum int64)
- func (n *NumberInput) SetMaximumValueUint64(maximum uint64)
- func (n *NumberInput) SetMinimumValue(minimum int)
- func (n *NumberInput) SetMinimumValueBigInt(minimum *big.Int)
- func (n *NumberInput) SetMinimumValueInt64(minimum int64)
- func (n *NumberInput) SetMinimumValueUint64(minimum uint64)
- func (n *NumberInput) SetStep(step int)
- func (n *NumberInput) SetStepBigInt(step *big.Int)
- func (n *NumberInput) SetStepInt64(step int64)
- func (n *NumberInput) SetStepUint64(step uint64)
- func (n *NumberInput) SetSupportText(text string)
- func (n *NumberInput) SetValue(value int)
- func (n *NumberInput) SetValueBigInt(value *big.Int)
- func (n *NumberInput) SetValueInt64(value int64)
- func (n *NumberInput) SetValueUint64(value uint64)
- func (n *NumberInput) SupportText() string
- func (n *NumberInput) Value() int
- func (n *NumberInput) ValueBigInt() *big.Int
- func (n *NumberInput) ValueInt64() int64
- func (n *NumberInput) ValueUint64() uint64
- type Panel
- func (p *Panel) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (p *Panel) EnsureRectangleVisible(rect image.Rectangle)
- func (p *Panel) ForceSetScrollOffset(offsetX, offsetY float64)
- func (p *Panel) ForceSetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)
- func (p *Panel) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (p *Panel) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *Panel) OnScroll(callback func(context *guigui.Context, offsetX, offsetY float64))
- func (p *Panel) SetAutoBorder(auto bool)
- func (p *Panel) SetBackgroundStyle(style PanelBackgroundStyle)
- func (p *Panel) SetBorders(borders PanelBorders)
- func (p *Panel) SetContent(widget guigui.Widget)
- func (p *Panel) SetContentConstraints(c PanelContentConstraints)
- func (p *Panel) SetScrollOffset(offsetX, offsetY float64)
- func (p *Panel) SetScrollOffsetByDelta(offsetXDelta, offsetYDelta float64)
- func (p *Panel) SetStyle(typ PanelStyle)
- type PanelBackgroundStyle
- type PanelBorders
- type PanelContentConstraints
- type PanelStyle
- type Popup
- func (p *Popup) BringToFrontLayer(context *guigui.Context)
- func (p *Popup) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (p *Popup) Env(context *guigui.Context, key guigui.EnvKey, source *guigui.EnvSource) (any, bool)
- func (p *Popup) IsOpen() bool
- func (p *Popup) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (p *Popup) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *Popup) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
- func (p *Popup) SetAnimated(animateOnFading bool)
- func (p *Popup) SetBackgroundBlurred(blurred bool)
- func (p *Popup) SetBackgroundBounds(bounds image.Rectangle)
- func (p *Popup) SetBackgroundDark(dark bool)
- func (p *Popup) SetCloseByClickingOutside(closeByClickingOutside bool)
- func (p *Popup) SetContent(widget guigui.Widget)
- func (p *Popup) SetModal(modal bool)
- func (p *Popup) SetOpen(open bool)
- func (p *Popup) SetTintColor(tint color.Color)
- type PopupCloseReason
- type PopupMenu
- func (p *PopupMenu[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (p *PopupMenu[T]) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (p *PopupMenu[T]) IsOpen() bool
- func (p *PopupMenu[T]) ItemByIndex(index int) (PopupMenuItem[T], bool)
- func (p *PopupMenu[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (p *PopupMenu[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *PopupMenu[T]) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
- func (p *PopupMenu[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (p *PopupMenu[T]) SelectItemByIndex(index int)
- func (p *PopupMenu[T]) SelectItemByValue(value T)
- func (p *PopupMenu[T]) SelectedItem() (PopupMenuItem[T], bool)
- func (p *PopupMenu[T]) SelectedItemIndex() int
- func (p *PopupMenu[T]) SetItems(items []PopupMenuItem[T])
- func (p *PopupMenu[T]) SetItemsByStrings(items []string)
- func (p *PopupMenu[T]) SetOpen(open bool)
- func (p *PopupMenu[T]) SetReservesCheckmarkSpace(reserves bool)
- type PopupMenuItem
- type ProgressBar
- func (p *ProgressBar) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (p *ProgressBar) MaximumValueBigInt() *big.Int
- func (p *ProgressBar) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (p *ProgressBar) MinimumValueBigInt() *big.Int
- func (p *ProgressBar) SetMaximumValue(maximum int)
- func (p *ProgressBar) SetMaximumValueBigInt(maximum *big.Int)
- func (p *ProgressBar) SetMaximumValueInt64(maximum int64)
- func (p *ProgressBar) SetMaximumValueUint64(maximum uint64)
- func (p *ProgressBar) SetMinimumValue(minimum int)
- func (p *ProgressBar) SetMinimumValueBigInt(minimum *big.Int)
- func (p *ProgressBar) SetMinimumValueInt64(minimum int64)
- func (p *ProgressBar) SetMinimumValueUint64(minimum uint64)
- func (p *ProgressBar) SetValue(value int)
- func (p *ProgressBar) SetValueBigInt(value *big.Int)
- func (p *ProgressBar) SetValueInt64(value int64)
- func (p *ProgressBar) SetValueUint64(value uint64)
- func (p *ProgressBar) Value() int
- func (p *ProgressBar) ValueBigInt() *big.Int
- func (p *ProgressBar) ValueInt64() int64
- func (p *ProgressBar) ValueUint64() uint64
- func (p *ProgressBar) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type RadioButton
- func (r *RadioButton[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (r *RadioButton[T]) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (r *RadioButton[T]) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (r *RadioButton[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (r *RadioButton[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (r *RadioButton[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (r *RadioButton[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (r *RadioButton[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type RadioButtonGroup
- func (r *RadioButtonGroup[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (r *RadioButtonGroup[T]) RadioButton(index int) *RadioButton[T]
- func (r *RadioButtonGroup[T]) SelectItemByIndex(index int)
- func (r *RadioButtonGroup[T]) SelectItemByValue(value T)
- func (r *RadioButtonGroup[T]) SelectedIndex() int
- func (r *RadioButtonGroup[T]) SelectedValue() (T, bool)
- func (r *RadioButtonGroup[T]) SetValues(values []T)
- func (r *RadioButtonGroup[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type SegmentedControl
- func (s *SegmentedControl[T]) AppendSelectedItemIndices(indices []int) []int
- func (s *SegmentedControl[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (s *SegmentedControl[T]) ItemByIndex(index int) (SegmentedControlItem[T], bool)
- func (s *SegmentedControl[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (s *SegmentedControl[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (s *SegmentedControl[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (s *SegmentedControl[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))
- func (s *SegmentedControl[T]) SelectItemByIndex(index int)
- func (s *SegmentedControl[T]) SelectItemByValue(value T)
- func (s *SegmentedControl[T]) SelectItemsByIndices(indices []int)
- func (s *SegmentedControl[T]) SelectItemsByValues(values []T)
- func (s *SegmentedControl[T]) SelectedItem() (SegmentedControlItem[T], bool)
- func (s *SegmentedControl[T]) SelectedItemCount() int
- func (s *SegmentedControl[T]) SelectedItemIndex() int
- func (s *SegmentedControl[T]) SetDirection(direction SegmentedControlDirection)
- func (s *SegmentedControl[T]) SetItems(items []SegmentedControlItem[T])
- func (s *SegmentedControl[T]) SetMultiSelection(multi bool)
- func (s *SegmentedControl[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type SegmentedControlDirection
- type SegmentedControlItem
- type Select
- func (s *Select[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (s *Select[T]) IsPopupOpen() bool
- func (s *Select[T]) ItemByIndex(index int) (SelectItem[T], bool)
- func (s *Select[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (s *Select[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (s *Select[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (s *Select[T]) SelectItemByIndex(index int)
- func (s *Select[T]) SelectItemByValue(value T)
- func (s *Select[T]) SelectedItem() (SelectItem[T], bool)
- func (s *Select[T]) SelectedItemIndex() int
- func (s *Select[T]) SetItems(items []SelectItem[T])
- func (s *Select[T]) SetItemsByStrings(items []string)
- type SelectItem
- type Slider
- func (s *Slider) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (s *Slider) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (s *Slider) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (s *Slider) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (s *Slider) MaximumValueBigInt() *big.Int
- func (s *Slider) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (s *Slider) MinimumValueBigInt() *big.Int
- func (s *Slider) OnValueChanged(f func(context *guigui.Context, value int))
- func (s *Slider) OnValueChangedBigInt(f func(context *guigui.Context, value *big.Int))
- func (s *Slider) OnValueChangedInt64(f func(context *guigui.Context, value int64))
- func (s *Slider) OnValueChangedUint64(f func(context *guigui.Context, value uint64))
- func (s *Slider) SetMaximumValue(maximum int)
- func (s *Slider) SetMaximumValueBigInt(maximum *big.Int)
- func (s *Slider) SetMaximumValueInt64(maximum int64)
- func (s *Slider) SetMaximumValueUint64(maximum uint64)
- func (s *Slider) SetMinimumValue(minimum int)
- func (s *Slider) SetMinimumValueBigInt(minimum *big.Int)
- func (s *Slider) SetMinimumValueInt64(minimum int64)
- func (s *Slider) SetMinimumValueUint64(minimum uint64)
- func (s *Slider) SetSnapOnly(snapOnly bool)
- func (s *Slider) SetStep(step int)
- func (s *Slider) SetStepBigInt(step *big.Int)
- func (s *Slider) SetStepInt64(step int64)
- func (s *Slider) SetStepUint64(step uint64)
- func (s *Slider) SetValue(value int)
- func (s *Slider) SetValueBigInt(value *big.Int)
- func (s *Slider) SetValueInt64(value int64)
- func (s *Slider) SetValueUint64(value uint64)
- func (s *Slider) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (s *Slider) Value() int
- func (s *Slider) ValueBigInt() *big.Int
- func (s *Slider) ValueInt64() int64
- func (s *Slider) ValueUint64() uint64
- func (s *Slider) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type Table
- func (t *Table[T]) AppendSelectedItemIndices(indices []int) []int
- func (t *Table[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *Table[T]) CellBounds(rowIndex, colIndex int) image.Rectangle
- func (t *Table[T]) EnsureItemVisibleByIndex(index int)
- func (t *Table[T]) ForceEnsureItemVisibleByIndex(index int)
- func (t *Table[T]) ForceSetScrollPosition(position ListScrollPosition)
- func (t *Table[T]) ID(index int) any
- func (t *Table[T]) IndexByValue(value T) int
- func (t *Table[T]) IsItemAvailable(index int) bool
- func (t *Table[T]) IsItemInViewport(index int) bool
- func (t *Table[T]) ItemBounds(index int) image.Rectangle
- func (t *Table[T]) ItemByIndex(index int) (TableRow[T], bool)
- func (t *Table[T]) ItemCount() int
- func (t *Table[T]) JumpToItemByIndex(index int)
- func (t *Table[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *Table[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *Table[T]) OnItemSelected(f func(context *guigui.Context, index int))
- func (t *Table[T]) OnItemsCanMove(f func(context *guigui.Context, from, count, to int) bool)
- func (t *Table[T]) OnItemsMoved(f func(context *guigui.Context, from, count, to int))
- func (t *Table[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))
- func (t *Table[T]) OnScroll(callback func(context *guigui.Context, position ListScrollPosition))
- func (t *Table[T]) ScrollPosition() ListScrollPosition
- func (t *Table[T]) SelectAllItems()
- func (t *Table[T]) SelectItemByIndex(index int)
- func (t *Table[T]) SelectItemByValue(value T)
- func (t *Table[T]) SelectItemsByIndices(indices []int)
- func (t *Table[T]) SelectItemsByValues(values []T)
- func (t *Table[T]) SelectedItem() (TableRow[T], bool)
- func (t *Table[T]) SelectedItemCount() int
- func (t *Table[T]) SelectedItemIndex() int
- func (t *Table[T]) SetColumns(columns []TableColumn)
- func (t *Table[T]) SetFooterHeight(height int)
- func (t *Table[T]) SetItemHeight(height int)
- func (t *Table[T]) SetItems(items []TableRow[T])
- func (t *Table[T]) SetMultiSelection(multi bool)
- func (t *Table[T]) SetReservesCheckmarkSpace(reserves bool)
- func (t *Table[T]) SetScrollPosition(position ListScrollPosition)
- func (t *Table[T]) SetUnfocusedSelectionVisible(visible bool)
- type TableCell
- type TableColumn
- type TableRow
- type Text
- func (t *Text) AppendBoundsOfTextRange(dst []image.Rectangle, context *guigui.Context, bounds image.Rectangle, ...) []image.Rectangle
- func (t *Text) AppendHotspotRanges(dst []TextRange) []TextRange
- func (t *Text) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *Text) CanCopy() bool
- func (t *Text) CanCut() bool
- func (t *Text) CanPaste() bool
- func (t *Text) CanRedo() bool
- func (t *Text) CanUndo() bool
- func (t *Text) CaretPositionAtTextIndexInBytes(context *guigui.Context, textIndexInBytes int) (top, bottom image.Point, ok bool)
- func (t *Text) CommitWithCurrentInputValue()
- func (t *Text) Copy() bool
- func (t *Text) Cut() bool
- func (t *Text) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (t *Text) ForceSetValue(text string)
- func (t *Text) HasValue() bool
- func (t *Text) HorizontalAlign() HorizontalAlign
- func (t *Text) IsEditable() bool
- func (t *Text) IsMultiline() bool
- func (t *Text) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *Text) LineCount() int
- func (t *Text) LineIndexFromTextIndexInBytes(textIndexInBytes int) int
- func (t *Text) LineStartInBytes(lineIndex int) int
- func (t *Text) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *Text) OnHandleButtonInput(...)
- func (t *Text) OnHotspotDown(f func(context *guigui.Context, textRange TextRange))
- func (t *Text) OnHotspotUp(f func(context *guigui.Context, textRange TextRange))
- func (t *Text) OnInsertionStyleReset(f func(context *guigui.Context))
- func (t *Text) OnValueChanged(f func(context *guigui.Context, text string, committed bool))
- func (t *Text) OnValueChangedWithoutText(f func(context *guigui.Context, committed bool))
- func (t *Text) Paste() bool
- func (t *Text) PasteWithoutStyles() bool
- func (t *Text) ReadBaseStyle(style *TextStyle)
- func (t *Text) ReadEffectiveStyleAt(style *TextStyle, textIndexInBytes int)
- func (t *Text) ReadEffectiveStyles(styles *TextStyles)
- func (t *Text) ReadEffectiveStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
- func (t *Text) ReadOverrideStyles(styles *TextStyles)
- func (t *Text) ReadOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
- func (t *Text) ReadValueFrom(r io.Reader) (int64, error)
- func (t *Text) Redo() bool
- func (t *Text) ReplaceValueAtSelection(text string)
- func (t *Text) Selection() (start, end int)
- func (t *Text) SetBaseStyle(style *TextStyle)
- func (t *Text) SetCaretBlinking(caretBlinking bool)
- func (t *Text) SetEditable(editable bool)
- func (t *Text) SetEllipsisString(str string)
- func (t *Text) SetFontSize(size float64)
- func (t *Text) SetHorizontalAlign(align HorizontalAlign)
- func (t *Text) SetHotspotRanges(ranges []TextRange)
- func (t *Text) SetInsertionStyle(style *TextStyle)
- func (t *Text) SetLineHeight(lineHeight float64)
- func (t *Text) SetLineHeightMode(lineHeightMode LineHeightMode)
- func (t *Text) SetLocales(locales []language.Tag)
- func (t *Text) SetMaskRune(maskRune rune)
- func (t *Text) SetMultiline(multiline bool)
- func (t *Text) SetOpacity(opacity float64)
- func (t *Text) SetOverrideStyles(styles *TextStyles, recorded bool)
- func (t *Text) SetOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int, recorded bool)
- func (t *Text) SetPlaceholder(placeholder string)
- func (t *Text) SetRichTextEditable(richTextEditable bool)
- func (t *Text) SetScale(scale float64)
- func (t *Text) SetSelectable(selectable bool)
- func (t *Text) SetSelection(start, end int)
- func (t *Text) SetSelectionVisibleWhenUnfocused(visible bool)
- func (t *Text) SetTabWidth(tabWidth float64)
- func (t *Text) SetValue(text string)
- func (t *Text) SetVerticalAlign(align VerticalAlign)
- func (t *Text) SetWrapMode(wrapMode WrapMode)
- func (t *Text) Undo() bool
- func (t *Text) Value() string
- func (t *Text) VerticalAlign() VerticalAlign
- func (t *Text) WrapMode() WrapMode
- func (t *Text) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- func (t *Text) WriteValueRangeTo(w io.Writer, startInBytes, endInBytes int) (int64, error)
- func (t *Text) WriteValueTo(w io.Writer) (int64, error)
- type TextInput
- func (t *TextInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *TextInput) CanCopy() bool
- func (t *TextInput) CanCut() bool
- func (t *TextInput) CanPaste() bool
- func (t *TextInput) CanRedo() bool
- func (t *TextInput) CanUndo() bool
- func (t *TextInput) CaretPositionAtTextIndexInBytes(context *guigui.Context, textIndexInBytes int) (top, bottom image.Point, ok bool)
- func (t *TextInput) CommitWithCurrentInputValue()
- func (t *TextInput) Copy() bool
- func (t *TextInput) Cut() bool
- func (t *TextInput) ForceSetValue(text string)
- func (t *TextInput) HasValue() bool
- func (t *TextInput) IsEditable() bool
- func (t *TextInput) IsError() bool
- func (t *TextInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *TextInput) LineCount() int
- func (t *TextInput) LineIndexFromTextIndexInBytes(textIndexInBytes int) int
- func (t *TextInput) LineStartInBytes(lineIndex int) int
- func (t *TextInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *TextInput) OnHandleButtonInput(...)
- func (t *TextInput) OnInsertionStyleReset(f func(context *guigui.Context))
- func (t *TextInput) OnValueChanged(f func(context *guigui.Context, text string, committed bool))
- func (t *TextInput) OnValueChangedWithoutText(f func(context *guigui.Context, committed bool))
- func (t *TextInput) Paste() bool
- func (t *TextInput) PasteWithoutStyles() bool
- func (t *TextInput) ReadBaseStyle(style *TextStyle)
- func (t *TextInput) ReadEffectiveStyleAt(style *TextStyle, textIndexInBytes int)
- func (t *TextInput) ReadEffectiveStyles(styles *TextStyles)
- func (t *TextInput) ReadEffectiveStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
- func (t *TextInput) ReadOverrideStyles(styles *TextStyles)
- func (t *TextInput) ReadOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
- func (t *TextInput) ReadValueFrom(r io.Reader) (int64, error)
- func (t *TextInput) Redo() bool
- func (t *TextInput) ReplaceValueAtSelection(text string)
- func (t *TextInput) SelectAll()
- func (t *TextInput) Selection() (start, end int)
- func (t *TextInput) SetBaseStyle(style *TextStyle)
- func (t *TextInput) SetCaretBlinking(caretBlinking bool)
- func (t *TextInput) SetEditable(editable bool)
- func (t *TextInput) SetError(hasError bool)
- func (t *TextInput) SetFocusBorderVisible(visible bool)
- func (t *TextInput) SetHorizontalAlign(halign HorizontalAlign)
- func (t *TextInput) SetIcon(icon *ebiten.Image)
- func (t *TextInput) SetInsertionStyle(style *TextStyle)
- func (t *TextInput) SetLineHeight(lineHeight float64)
- func (t *TextInput) SetLineHeightMode(lineHeightMode LineHeightMode)
- func (t *TextInput) SetMaskRune(maskRune rune)
- func (t *TextInput) SetMultiline(multiline bool)
- func (t *TextInput) SetOverrideStyles(styles *TextStyles, recorded bool)
- func (t *TextInput) SetOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int, recorded bool)
- func (t *TextInput) SetPlaceholder(placeholder string)
- func (t *TextInput) SetRichTextEditable(richTextEditable bool)
- func (t *TextInput) SetSelection(start, end int)
- func (t *TextInput) SetSelectionVisibleWhenUnfocused(visible bool)
- func (t *TextInput) SetStyle(style TextInputStyle)
- func (t *TextInput) SetSupportText(text string)
- func (t *TextInput) SetValue(text string)
- func (t *TextInput) SetVerticalAlign(valign VerticalAlign)
- func (t *TextInput) SetWrapMode(wrapMode WrapMode)
- func (t *TextInput) SupportText() string
- func (t *TextInput) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *TextInput) Undo() bool
- func (t *TextInput) Value() string
- func (t *TextInput) WrapMode() WrapMode
- func (t *TextInput) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- func (t *TextInput) WriteValueRangeTo(w io.Writer, startInBytes, endInBytes int) (int64, error)
- func (t *TextInput) WriteValueTo(w io.Writer) (int64, error)
- type TextInputStyle
- type TextRange
- type TextStyle
- func (s *TextStyle) BackgroundColor() (color.Color, bool)
- func (s *TextStyle) Color() (color.Color, bool)
- func (s *TextStyle) Feature(tag text.Tag) (uint32, bool)
- func (s *TextStyle) FontFamily() (*FontFamily, bool)
- func (s *TextStyle) Italic() (italic, ok bool)
- func (s *TextStyle) Lang() (language.Tag, bool)
- func (s *TextStyle) Scale() (float64, bool)
- func (s *TextStyle) SetBackgroundColor(clr color.Color)
- func (s *TextStyle) SetBold(bold bool)
- func (s *TextStyle) SetColor(clr color.Color)
- func (s *TextStyle) SetFeature(tag text.Tag, value uint32)
- func (s *TextStyle) SetFontFamily(family *FontFamily)
- func (s *TextStyle) SetItalic(italic bool)
- func (s *TextStyle) SetLang(lang language.Tag)
- func (s *TextStyle) SetScale(scale float64)
- func (s *TextStyle) SetStrikethrough(strikethrough bool)
- func (s *TextStyle) SetTabular(tabular bool)
- func (s *TextStyle) SetUnderline(underline bool)
- func (s *TextStyle) SetVariation(tag text.Tag, value float32)
- func (s *TextStyle) SetWeight(weight text.Weight)
- func (s *TextStyle) Strikethrough() (strikethrough, ok bool)
- func (s *TextStyle) Tabular() (tabular, ok bool)
- func (s *TextStyle) Underline() (underline, ok bool)
- func (s *TextStyle) UnsetBackgroundColor()
- func (s *TextStyle) UnsetColor()
- func (s *TextStyle) UnsetFeature(tag text.Tag)
- func (s *TextStyle) UnsetFontFamily()
- func (s *TextStyle) UnsetItalic()
- func (s *TextStyle) UnsetLang()
- func (s *TextStyle) UnsetScale()
- func (s *TextStyle) UnsetStrikethrough()
- func (s *TextStyle) UnsetTabular()
- func (s *TextStyle) UnsetUnderline()
- func (s *TextStyle) UnsetVariation(tag text.Tag)
- func (s *TextStyle) UnsetWeight()
- func (s *TextStyle) Variation(tag text.Tag) (float32, bool)
- func (s *TextStyle) Weight() (text.Weight, bool)
- type TextStyles
- func (s *TextStyles) ColorInRange(startInBytes, endInBytes int, fallback color.Color) (clr color.Color, uniform bool)
- func (s *TextStyles) ItalicInRange(startInBytes, endInBytes int, fallback bool) (italic, uniform bool)
- func (s *TextStyles) ResetStylesInRange(startInBytes, endInBytes int)
- func (s *TextStyles) ScaleInRange(startInBytes, endInBytes int, fallback float64) (scale float64, uniform bool)
- func (s *TextStyles) SetBackgroundColorInRange(startInBytes, endInBytes int, clr color.Color)
- func (s *TextStyles) SetColorInRange(startInBytes, endInBytes int, clr color.Color)
- func (s *TextStyles) SetFeatureInRange(startInBytes, endInBytes int, tag text.Tag, value uint32)
- func (s *TextStyles) SetFontFamilyInRange(startInBytes, endInBytes int, family *FontFamily)
- func (s *TextStyles) SetItalicInRange(startInBytes, endInBytes int, italic bool)
- func (s *TextStyles) SetLangInRange(startInBytes, endInBytes int, lang language.Tag)
- func (s *TextStyles) SetScaleInRange(startInBytes, endInBytes int, scale float64)
- func (s *TextStyles) SetStrikethroughInRange(startInBytes, endInBytes int, strikethrough bool)
- func (s *TextStyles) SetUnderlineInRange(startInBytes, endInBytes int, underline bool)
- func (s *TextStyles) SetVariationInRange(startInBytes, endInBytes int, tag text.Tag, value float32)
- func (s *TextStyles) SetWeightInRange(startInBytes, endInBytes int, weight text.Weight)
- func (s *TextStyles) StrikethroughInRange(startInBytes, endInBytes int, fallback bool) (strikethrough, uniform bool)
- func (s *TextStyles) UnderlineInRange(startInBytes, endInBytes int, fallback bool) (underline, uniform bool)
- func (s *TextStyles) UnsetBackgroundColorInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetColorInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetFeatureInRange(startInBytes, endInBytes int, tag text.Tag)
- func (s *TextStyles) UnsetFontFamilyInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetItalicInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetLangInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetScaleInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetStrikethroughInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetUnderlineInRange(startInBytes, endInBytes int)
- func (s *TextStyles) UnsetVariationInRange(startInBytes, endInBytes int, tag text.Tag)
- func (s *TextStyles) UnsetWeightInRange(startInBytes, endInBytes int)
- func (s *TextStyles) VariationInRange(startInBytes, endInBytes int, tag text.Tag, fallback float32) (value float32, uniform bool)
- func (s *TextStyles) WeightInRange(startInBytes, endInBytes int, fallback text.Weight) (weight text.Weight, uniform bool)
- type Toggle
- func (t *Toggle) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
- func (t *Toggle) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
- func (t *Toggle) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
- func (t *Toggle) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *Toggle) OnValueChanged(f func(context *guigui.Context, value bool))
- func (t *Toggle) SetValue(value bool)
- func (t *Toggle) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *Toggle) Value() bool
- func (t *Toggle) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type TooltipArea
- func (t *TooltipArea) Build(context *guigui.Context, adder *guigui.ChildAdder) error
- func (t *TooltipArea) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, ...)
- func (t *TooltipArea) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
- func (t *TooltipArea) SetContent(widget guigui.Widget)
- func (t *TooltipArea) SetHitAreas(areas []image.Rectangle)
- func (t *TooltipArea) SetText(text string)
- func (t *TooltipArea) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
- func (t *TooltipArea) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
- type UnicodeRange
- type VerticalAlign
- type WrapMode
Constants ¶
const ( FaceSourceEntryPriorityLow = FaceSourceEntryPriority(font.FaceSourceEntryPriorityLow) FaceSourceEntryPriorityNormal = FaceSourceEntryPriority(font.FaceSourceEntryPriorityNormal) FaceSourceEntryPriorityHigh = FaceSourceEntryPriority(font.FaceSourceEntryPriorityHigh) )
Variables ¶
var EnvKeyListItemColorType guigui.EnvKey = guigui.GenerateEnvKey()
EnvKeyListItemColorType is the environment key for obtaining a ListItemColorType from a list item. This is provided by the list's internal content widget, so descendant widgets of list items can query their color type without needing to know their index.
This value is available after the build phase (e.g., during the layout phase).
guigui.Context.Env with this key might return (nil, false) when the item is out of the viewport.
Functions ¶
func AccentTintColor ¶
AccentTintColor returns the tint marking the primary action of the theme.
func CreateMonochromeImage ¶
func DangerTintColor ¶
DangerTintColor returns the tint marking a destructive action or an error.
func InfoTintColor ¶
InfoTintColor returns the tint marking neutral information.
func LineHeight ¶
func RegisterFaceSourceEntries ¶
func RegisterFaceSourceEntries(add func(*guigui.Context, *FaceSourceEntryAdder))
RegisterFaceSourceEntries registers add as a contributor to the fallback resolution stack. add adds its face source entries through the provided FaceSourceEntryAdder.
func RoundedCornerRadius ¶
func SuccessTintColor ¶
SuccessTintColor returns the tint marking a successful result.
func TextColorFromTint ¶
TextColorFromTint returns the color to draw text tinted with tint, for use with TextStyle.SetColor. A nil tint returns the color for enabled text.
func TooltipTextPadding ¶
TooltipTextPadding returns the padding for tooltip text content.
func WarningTintColor ¶
WarningTintColor returns the tint marking a condition that needs attention.
Types ¶
type Background ¶
type Background struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Background) Draw ¶
func (b *Background) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
func (*Background) SetTintColor ¶
func (b *Background) SetTintColor(tint color.Color)
SetTintColor sets the color the background derives its fill from. A nil tint restores the default fill.
func (*Background) WriteStateKey ¶
func (b *Background) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type Button ¶
type Button struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Button) CursorShape ¶
func (b *Button) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*Button) HandlePointingInput ¶
func (b *Button) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*Button) Layout ¶
func (b *Button) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Button) SetContent ¶
func (*Button) SetIconAlign ¶
func (*Button) SetPressed ¶
SetPressed sets whether the button stays pressed.
A pressed button ignores clicks unless the button is toggleable.
func (*Button) SetSharpCorners ¶
func (*Button) SetTextBold ¶
func (*Button) SetTintColor ¶
SetTintColor sets the color the button derives its appearance from. A nil tint restores the default appearance. A primary button ignores the tint.
func (*Button) SetToggleable ¶
SetToggleable sets whether the button works as a toggle button.
A toggleable button accepts clicks even while it is pressed.
func (*Button) SetType ¶
func (b *Button) SetType(typ ButtonType)
func (*Button) WriteStateKey ¶
func (b *Button) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type ButtonType ¶
type ButtonType int
const ( ButtonTypeNormal ButtonType = iota ButtonTypePrimary )
type Checkbox ¶
type Checkbox struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Checkbox) CursorShape ¶
func (c *Checkbox) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*Checkbox) HandlePointingInput ¶
func (c *Checkbox) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*Checkbox) Layout ¶
func (c *Checkbox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Checkbox) OnValueChanged ¶
func (*Checkbox) WriteStateKey ¶
func (c *Checkbox) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type Combobox ¶
type Combobox struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
Combobox is a composite widget that combines a TextInput with a PopupMenu. The popup menu shows filtered items based on the current input text. When the user focuses the text input, the popup opens below (or above) the text input. The popup is modeless, so the text input retains focus while the popup is shown. The popup closes when the text input loses focus.
func (*Combobox) Layout ¶
func (c *Combobox) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Combobox) OnValueChanged ¶
OnValueChanged sets the event handler that is called when the combobox value changes. The handler receives the current text and whether the change is committed.
func (*Combobox) SetAllowFreeInput ¶
SetAllowFreeInput sets whether the combobox allows values that are not in the items list. When false, the value is reverted to the last valid value on commit if it does not match any item.
func (*Combobox) SetError ¶
SetError sets whether the combobox is in the error state. When the error state is true, the combobox border is drawn in a danger color.
func (*Combobox) SetSupportText ¶
SetSupportText sets the support text displayed below the combobox. The support text is shown in a subdued color, or in a danger color when the error state is true. A line break starts a new line.
func (*Combobox) SupportText ¶
SupportText returns the support text displayed below the combobox.
type ContextMenuArea ¶
type ContextMenuArea[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
ContextMenuArea is a standalone widget that shows a popup menu when the user right-clicks inside the area specified by its bounds.
ContextMenuArea shows a modeless popup that closes when the user clicks outside. The previously focused widget retains focus while the context menu is open, so that widgets like TextInput can continue to show their cursor and selection.
Use ContextMenuArea.PopupMenu to configure the menu items.
func (*ContextMenuArea[T]) Build ¶
func (c *ContextMenuArea[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
Build implements guigui.Widget.Build.
func (*ContextMenuArea[T]) HandlePointingInput ¶
func (c *ContextMenuArea[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
HandlePointingInput implements guigui.Widget.HandlePointingInput.
func (*ContextMenuArea[T]) Layout ¶
func (c *ContextMenuArea[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
Layout implements guigui.Widget.Layout.
func (*ContextMenuArea[T]) Measure ¶
func (c *ContextMenuArea[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
Measure implements guigui.Widget.Measure.
func (*ContextMenuArea[T]) PopupMenu ¶
func (c *ContextMenuArea[T]) PopupMenu() *PopupMenu[T]
PopupMenu returns the popup menu so that the caller can configure its items and event handlers.
type Drawer ¶
type Drawer struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Drawer) Layout ¶
func (d *Drawer) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Drawer) OnClose ¶
func (d *Drawer) OnClose(onClose func(context *guigui.Context, reason PopupCloseReason))
func (*Drawer) SetAnimated ¶
func (*Drawer) SetBackgroundBlurred ¶
func (*Drawer) SetBackgroundBounds ¶
func (*Drawer) SetBackgroundDark ¶
func (*Drawer) SetCloseByClickingOutside ¶
func (*Drawer) SetContent ¶
func (*Drawer) SetDrawerEdge ¶
func (d *Drawer) SetDrawerEdge(edge DrawerEdge)
func (*Drawer) SetTintColor ¶
SetTintColor sets the color the drawer derives its background from. A nil tint restores the default background.
type DrawerEdge ¶
type DrawerEdge int
const ( DrawerEdgeStart DrawerEdge = iota DrawerEdgeTop DrawerEdgeEnd DrawerEdgeBottom )
type Expander ¶
type Expander struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Expander) Layout ¶
func (e *Expander) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Expander) OnExpansionChanged ¶
func (*Expander) SetContentWidget ¶
func (*Expander) SetExpanded ¶
func (*Expander) SetHeaderWidget ¶
func (*Expander) WriteStateKey ¶
func (e *Expander) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type FaceSourceEntry ¶
type FaceSourceEntry struct {
FaceSource *text.GoTextFaceSource
UnicodeRanges []UnicodeRange
}
func DefaultFaceSourceEntry ¶
func DefaultFaceSourceEntry() FaceSourceEntry
DefaultFaceSourceEntry returns the entry for the bundled default face.
type FaceSourceEntryAdder ¶
type FaceSourceEntryAdder struct {
// contains filtered or unexported fields
}
FaceSourceEntryAdder collects face source entries for the fallback resolution stack.
func (*FaceSourceEntryAdder) Add ¶
func (a *FaceSourceEntryAdder) Add(entry FaceSourceEntry)
Add adds entry to the fallback resolution stack at the adder's current priority, which is FaceSourceEntryPriorityNormal until changed by SetPriority.
func (*FaceSourceEntryAdder) SetPriority ¶
func (a *FaceSourceEntryAdder) SetPriority(priority FaceSourceEntryPriority)
SetPriority sets the priority applied to entries added afterward. A higher priority resolves earlier; entries of equal priority resolve in the order they are added.
type FaceSourceEntryPriority ¶
type FaceSourceEntryPriority int
FaceSourceEntryPriority orders providers registered with RegisterFaceSourceEntries; a higher value resolves earlier.
type FontFamily ¶
type FontFamily struct {
// contains filtered or unexported fields
}
FontFamily is an immutable ordered list of FaceSourceEntry values, optionally followed by the registered fallback stack. Size, weight, language, and OpenType features are not part of a FontFamily; they are applied at render time.
func NewFontFamily ¶
func NewFontFamily(entries []FaceSourceEntry, opts *FontFamilyOptions) *FontFamily
NewFontFamily returns a FontFamily that renders using entries. A nil opts is treated the same as the zero FontFamilyOptions.
type FontFamilyOptions ¶
type FontFamilyOptions struct {
// DisableFallback restricts rendering to the FontFamily's own entries,
// skipping the fallback stack.
DisableFallback bool
}
FontFamilyOptions controls how a FontFamily resolves glyphs.
type Form ¶
type Form struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Form) Layout ¶
func (f *Form) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
type HorizontalAlign ¶
type HorizontalAlign int
const ( HorizontalAlignStart HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignStart) HorizontalAlignCenter HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignCenter) HorizontalAlignEnd HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignEnd) HorizontalAlignLeft HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignLeft) HorizontalAlignRight HorizontalAlign = HorizontalAlign(textutil.HorizontalAlignRight) )
type Image ¶
type Image struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Image) WriteStateKey ¶
func (i *Image) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type ItemTextStyle ¶
type ItemTextStyle struct {
// Style is the base style of the text. A widget can override the
// properties it owns, such as the text color of a selected item.
Style TextStyle
HorizontalAlign HorizontalAlign
VerticalAlign VerticalAlign
WrapMode WrapMode
}
ItemTextStyle bundles the styling attributes applied to the fallback text rendered when a widget's Content is nil.
type LineHeightMode ¶
type LineHeightMode int
LineHeightMode selects how a visual line's height responds to the font sizes on it.
const ( // LineHeightModeFixed gives every visual line the same height. Text // larger than the line height overflows into the adjacent lines. LineHeightModeFixed LineHeightMode = LineHeightMode(textutil.LineHeightModeFixed) // LineHeightModeFlexible sizes each visual line to fit the largest font // on it: the line height and the baseline scale by the ratio of that // font's size to the base font size. LineHeightModeFlexible LineHeightMode = LineHeightMode(textutil.LineHeightModeFlexible) )
type List ¶
type List[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
func (*List[T]) AppendSelectedItemIndices ¶
func (*List[T]) EnsureItemVisibleByIndex ¶
func (*List[T]) ForceEnsureItemVisibleByIndex ¶
func (*List[T]) ForceSetScrollPosition ¶
func (l *List[T]) ForceSetScrollPosition(position ListScrollPosition)
ForceSetScrollPosition scrolls to the given position without animation.
func (*List[T]) IndexByValue ¶
func (*List[T]) IsItemAvailable ¶
IsItemAvailable reports whether the item at the given index is available in the list (i.e., not hidden by a collapsed ancestor).
func (*List[T]) IsItemInViewport ¶
IsItemInViewport reports whether the item at the given index is currently visible in the viewport.
IsItemInViewport is available after the layout phase.
func (*List[T]) JumpToItemByIndex ¶
func (*List[T]) Layout ¶
func (l *List[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*List[T]) OnItemExpanderToggled ¶
func (*List[T]) OnItemSelected ¶
func (*List[T]) OnItemsCanMove ¶
func (*List[T]) OnItemsMoved ¶
func (*List[T]) OnItemsSelected ¶
func (*List[T]) OnScroll ¶
func (l *List[T]) OnScroll(callback func(context *guigui.Context, position ListScrollPosition))
OnScroll sets the handler invoked when the scroll position changes.
func (*List[T]) ScrollPosition ¶
func (l *List[T]) ScrollPosition() ListScrollPosition
ScrollPosition returns a snapshot of the current scroll position, restorable with List.SetScrollPosition or List.ForceSetScrollPosition.
func (*List[T]) SelectAllItems ¶
func (l *List[T]) SelectAllItems()
func (*List[T]) SelectItemByIndex ¶
func (*List[T]) SelectItemByValue ¶
func (l *List[T]) SelectItemByValue(value T)
func (*List[T]) SelectItemsByIndices ¶
func (*List[T]) SelectItemsByValues ¶
func (l *List[T]) SelectItemsByValues(values []T)
func (*List[T]) SelectedItem ¶
func (*List[T]) SelectedItemCount ¶
func (*List[T]) SelectedItemIndex ¶
func (*List[T]) SetBackground ¶
func (*List[T]) SetBackgroundStyle ¶
func (l *List[T]) SetBackgroundStyle(style ListBackgroundStyle)
SetBackgroundStyle sets the background fill drawn behind the items.
func (*List[T]) SetCornerRounded ¶
SetCornerRounded sets whether the list clips its contents to rounded corners.
func (*List[T]) SetFooterHeight ¶
func (*List[T]) SetFrameVisible ¶
SetFrameVisible sets whether the list draws its frame, header, and footer.
func (*List[T]) SetHeaderHeight ¶
func (*List[T]) SetHighlightStyle ¶
func (l *List[T]) SetHighlightStyle(style ListItemHighlightStyle)
SetHighlightStyle sets which item the list highlights.
func (*List[T]) SetHighlightVisibleWhenUnfocused ¶
SetHighlightVisibleWhenUnfocused sets whether the highlight stays drawn while the list is unfocused.
func (*List[T]) SetHoverBackgroundVisible ¶
SetHoverBackgroundVisible sets whether the hovered item shows a background in the selection highlight style.
func (*List[T]) SetItemHeight ¶
func (*List[T]) SetItemString ¶
func (*List[T]) SetItemsByStrings ¶
func (*List[T]) SetMultiSelection ¶
func (*List[T]) SetReservesCheckmarkSpace ¶
SetReservesCheckmarkSpace sets whether the list reserves space for the checkmark column even when no item is currently checked. This keeps item widths and positions stable across check-state changes.
Items can independently toggle ListItem.Checked to render a checkmark. The column is automatically reserved when at least one item is checked, so this setter is only needed when no items are currently checked but might be in the future.
func (*List[T]) SetScrollPosition ¶
func (l *List[T]) SetScrollPosition(position ListScrollPosition)
SetScrollPosition scrolls to the given position with animation.
func (*List[T]) SetSelectedItemBold ¶
SetSelectedItemBold sets whether the selected item's text is drawn in bold.
func (*List[T]) SetStripeVisible ¶
func (*List[T]) SetStyle ¶
SetStyle applies the preset combination of orthogonal properties for the given style. SetStyle re-applies every property on each call, so a per-property override takes effect only when its setter is called after SetStyle.
func (*List[T]) SetUnfocusedSelectionVisible ¶
SetUnfocusedSelectionVisible sets whether to show the selection background when the list is unfocused. The default is true.
func (*List[T]) WriteStateKey ¶
func (l *List[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type ListBackgroundStyle ¶
type ListBackgroundStyle int
ListBackgroundStyle represents the background fill drawn behind a list's items.
const ( // ListBackgroundStyleContent fills the background with the content background color. ListBackgroundStyleContent ListBackgroundStyle = iota // ListBackgroundStyleMenu fills the background with the menu background color. ListBackgroundStyleMenu // ListBackgroundStyleNone draws no background fill. ListBackgroundStyleNone )
type ListItemColorType ¶
type ListItemColorType int
ListItemColorType represents the color state of a list item.
const ( ListItemColorTypeDefault ListItemColorType = iota ListItemColorTypeHighlighted ListItemColorTypeSelectedInUnfocusedList ListItemColorTypeItemDisabled ListItemColorTypeListDisabled ListItemColorTypeHovered )
func (ListItemColorType) BackgroundColor ¶
func (t ListItemColorType) BackgroundColor(context *guigui.Context) color.Color
BackgroundColor returns the background color for the given color type. BackgroundColor returns nil when no special background should be applied.
type ListItemHighlightStyle ¶
type ListItemHighlightStyle int
ListItemHighlightStyle represents which item a list draws its highlight on.
const ( // ListItemHighlightStyleSelection highlights the selected item; arrow keys move the selection. ListItemHighlightStyleSelection ListItemHighlightStyle = iota // ListItemHighlightStyleHover highlights the hovered item; arrow keys move a transient highlight committed by Enter. ListItemHighlightStyleHover )
type ListScrollPosition ¶
type ListScrollPosition struct {
// contains filtered or unexported fields
}
ListScrollPosition is an opaque snapshot of a list widget's scroll position (e.g. List or Table), obtained from List.ScrollPosition and restored with List.SetScrollPosition or List.ForceSetScrollPosition. The zero value is the top of the list.
type Menubar ¶
type Menubar[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
Menubar is a horizontal row of title texts. Clicking a title shows the associated popup menu. While any popup is open, moving the cursor onto a different title automatically switches to that title's popup. Clicking the already-open title closes its popup.
func (*Menubar[T]) Build ¶
Build implements guigui.Widget.Build.
func (*Menubar[T]) Layout ¶
func (m *Menubar[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
Layout implements guigui.Widget.Layout.
func (*Menubar[T]) Measure ¶
Measure implements guigui.Widget.Measure.
func (*Menubar[T]) OnItemSelected ¶
OnItemSelected sets the event handler that is invoked when a popup menu item is selected. menuIndex identifies the title and itemIndex identifies the selected item within that title's popup.
func (*Menubar[T]) PopupMenuAt ¶
PopupMenuAt returns the popup menu associated with the i-th item. Menubar.SetItems must be called first so that the popup at i exists.
Items shown in the popup are configured via PopupMenu.SetItems. A title whose popup has no items is automatically disabled.
func (*Menubar[T]) SetItems ¶
func (m *Menubar[T]) SetItems(items []MenubarItem)
SetItems sets the menubar's items. After this call, the popup menu for each item can be configured via Menubar.PopupMenuAt.
func (*Menubar[T]) WriteStateKey ¶
func (m *Menubar[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
WriteStateKey implements guigui.Widget.WriteStateKey.
type MenubarItem ¶
MenubarItem is a single entry in a Menubar. Each entry has a title text; the popup menu shown when the title is clicked is configured separately via Menubar.PopupMenuAt.
type NumberInput ¶
type NumberInput struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*NumberInput) Build ¶
func (n *NumberInput) Build(context *guigui.Context, adder *guigui.ChildAdder) error
func (*NumberInput) CanCopy ¶
func (n *NumberInput) CanCopy() bool
func (*NumberInput) CanCut ¶
func (n *NumberInput) CanCut() bool
func (*NumberInput) CanPaste ¶
func (n *NumberInput) CanPaste() bool
func (*NumberInput) CommitWithCurrentInputValue ¶
func (n *NumberInput) CommitWithCurrentInputValue()
func (*NumberInput) Copy ¶
func (n *NumberInput) Copy() bool
func (*NumberInput) Cut ¶
func (n *NumberInput) Cut() bool
func (*NumberInput) ForceSetValue ¶
func (n *NumberInput) ForceSetValue(value int)
func (*NumberInput) ForceSetValueBigInt ¶
func (n *NumberInput) ForceSetValueBigInt(value *big.Int)
func (*NumberInput) ForceSetValueInt64 ¶
func (n *NumberInput) ForceSetValueInt64(value int64)
func (*NumberInput) ForceSetValueUint64 ¶
func (n *NumberInput) ForceSetValueUint64(value uint64)
func (*NumberInput) IsEditable ¶
func (n *NumberInput) IsEditable() bool
func (*NumberInput) IsError ¶
func (n *NumberInput) IsError() bool
IsError reports whether the number input is in the error state.
func (*NumberInput) Layout ¶
func (n *NumberInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*NumberInput) MaximumValueBigInt ¶
func (n *NumberInput) MaximumValueBigInt() *big.Int
func (*NumberInput) Measure ¶
func (n *NumberInput) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
func (*NumberInput) MinimumValueBigInt ¶
func (n *NumberInput) MinimumValueBigInt() *big.Int
func (*NumberInput) OnHandleButtonInput ¶
func (n *NumberInput) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)
func (*NumberInput) OnValueChanged ¶
func (n *NumberInput) OnValueChanged(f func(context *guigui.Context, value int, committed bool))
func (*NumberInput) OnValueChangedBigInt ¶
func (*NumberInput) OnValueChangedInt64 ¶
func (n *NumberInput) OnValueChangedInt64(f func(context *guigui.Context, value int64, committed bool))
func (*NumberInput) OnValueChangedUint64 ¶
func (n *NumberInput) OnValueChangedUint64(f func(context *guigui.Context, value uint64, committed bool))
func (*NumberInput) Paste ¶
func (n *NumberInput) Paste() bool
func (*NumberInput) SetEditable ¶
func (n *NumberInput) SetEditable(editable bool)
func (*NumberInput) SetError ¶
func (n *NumberInput) SetError(hasError bool)
SetError sets whether the number input is in the error state. When the error state is true, the number input border is drawn in a danger color.
func (*NumberInput) SetMaximumValue ¶
func (n *NumberInput) SetMaximumValue(maximum int)
func (*NumberInput) SetMaximumValueBigInt ¶
func (n *NumberInput) SetMaximumValueBigInt(maximum *big.Int)
func (*NumberInput) SetMaximumValueInt64 ¶
func (n *NumberInput) SetMaximumValueInt64(maximum int64)
func (*NumberInput) SetMaximumValueUint64 ¶
func (n *NumberInput) SetMaximumValueUint64(maximum uint64)
func (*NumberInput) SetMinimumValue ¶
func (n *NumberInput) SetMinimumValue(minimum int)
func (*NumberInput) SetMinimumValueBigInt ¶
func (n *NumberInput) SetMinimumValueBigInt(minimum *big.Int)
func (*NumberInput) SetMinimumValueInt64 ¶
func (n *NumberInput) SetMinimumValueInt64(minimum int64)
func (*NumberInput) SetMinimumValueUint64 ¶
func (n *NumberInput) SetMinimumValueUint64(minimum uint64)
func (*NumberInput) SetStep ¶
func (n *NumberInput) SetStep(step int)
func (*NumberInput) SetStepBigInt ¶
func (n *NumberInput) SetStepBigInt(step *big.Int)
func (*NumberInput) SetStepInt64 ¶
func (n *NumberInput) SetStepInt64(step int64)
func (*NumberInput) SetStepUint64 ¶
func (n *NumberInput) SetStepUint64(step uint64)
func (*NumberInput) SetSupportText ¶
func (n *NumberInput) SetSupportText(text string)
SetSupportText sets the support text displayed below the number input. The support text is shown in a subdued color, or in a danger color when the error state is true. A line break starts a new line.
func (*NumberInput) SetValue ¶
func (n *NumberInput) SetValue(value int)
func (*NumberInput) SetValueBigInt ¶
func (n *NumberInput) SetValueBigInt(value *big.Int)
func (*NumberInput) SetValueInt64 ¶
func (n *NumberInput) SetValueInt64(value int64)
func (*NumberInput) SetValueUint64 ¶
func (n *NumberInput) SetValueUint64(value uint64)
func (*NumberInput) SupportText ¶
func (n *NumberInput) SupportText() string
SupportText returns the support text displayed below the number input.
func (*NumberInput) Value ¶
func (n *NumberInput) Value() int
func (*NumberInput) ValueBigInt ¶
func (n *NumberInput) ValueBigInt() *big.Int
func (*NumberInput) ValueInt64 ¶
func (n *NumberInput) ValueInt64() int64
func (*NumberInput) ValueUint64 ¶
func (n *NumberInput) ValueUint64() uint64
type Panel ¶
type Panel struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Panel) EnsureRectangleVisible ¶
EnsureRectangleVisible ensures the given rectangle, in content-local coordinates, is visible in the viewport by scrolling if necessary. If the rectangle is larger than the viewport, its top-left corner is aligned with the top-left of the viewport.
func (*Panel) ForceSetScrollOffset ¶
func (*Panel) ForceSetScrollOffsetByDelta ¶
func (*Panel) Layout ¶
func (p *Panel) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Panel) SetAutoBorder ¶
func (*Panel) SetBackgroundStyle ¶
func (p *Panel) SetBackgroundStyle(style PanelBackgroundStyle)
SetBackgroundStyle sets the background fill drawn behind the content.
func (*Panel) SetBorders ¶
func (p *Panel) SetBorders(borders PanelBorders)
func (*Panel) SetContent ¶
func (*Panel) SetContentConstraints ¶
func (p *Panel) SetContentConstraints(c PanelContentConstraints)
func (*Panel) SetScrollOffset ¶
func (*Panel) SetScrollOffsetByDelta ¶
func (*Panel) SetStyle ¶
func (p *Panel) SetStyle(typ PanelStyle)
SetStyle applies the preset combination of orthogonal properties for the given style. SetStyle re-applies every property on each call, so a per-property override takes effect only when its setter is called after SetStyle.
type PanelBackgroundStyle ¶
type PanelBackgroundStyle int
PanelBackgroundStyle represents the background fill drawn behind a panel's content.
const ( // PanelBackgroundStyleNone draws no background fill. PanelBackgroundStyleNone PanelBackgroundStyle = iota // PanelBackgroundStyleSecondary fills the background with the secondary background color. PanelBackgroundStyleSecondary )
type PanelContentConstraints ¶
type PanelContentConstraints int
const ( PanelContentConstraintsNone PanelContentConstraints = iota PanelContentConstraintsFixedWidth PanelContentConstraintsFixedHeight )
type Popup ¶
type Popup struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
Popup is a widget that displays its content on a separate layer.
Popup manages its own passthrough state based on whether it is open. Do not call guigui.Context.SetPassthrough on a Popup.
func (*Popup) BringToFrontLayer ¶
BringToFrontLayer brings the popup to the front layer.
func (*Popup) Layout ¶
func (p *Popup) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Popup) OnClose ¶
func (p *Popup) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
func (*Popup) SetAnimated ¶
func (*Popup) SetBackgroundBlurred ¶
func (*Popup) SetBackgroundBounds ¶
func (*Popup) SetBackgroundDark ¶
func (*Popup) SetCloseByClickingOutside ¶
func (*Popup) SetContent ¶
func (*Popup) SetTintColor ¶
SetTintColor sets the color the popup derives its background from. A nil tint restores the default background.
type PopupCloseReason ¶
type PopupCloseReason int
const ( PopupCloseReasonNone PopupCloseReason = iota PopupCloseReasonFuncCall PopupCloseReasonClickOutside PopupCloseReasonReopen PopupCloseReasonAuto )
type PopupMenu ¶
type PopupMenu[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
func (*PopupMenu[T]) HandleButtonInput ¶
func (p *PopupMenu[T]) HandleButtonInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
HandleButtonInput implements guigui.Widget.HandleButtonInput.
func (*PopupMenu[T]) ItemByIndex ¶
func (p *PopupMenu[T]) ItemByIndex(index int) (PopupMenuItem[T], bool)
func (*PopupMenu[T]) Layout ¶
func (p *PopupMenu[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*PopupMenu[T]) OnClose ¶
func (p *PopupMenu[T]) OnClose(f func(context *guigui.Context, reason PopupCloseReason))
func (*PopupMenu[T]) OnItemSelected ¶
func (*PopupMenu[T]) SelectItemByIndex ¶
func (*PopupMenu[T]) SelectItemByValue ¶
func (p *PopupMenu[T]) SelectItemByValue(value T)
func (*PopupMenu[T]) SelectedItem ¶
func (p *PopupMenu[T]) SelectedItem() (PopupMenuItem[T], bool)
func (*PopupMenu[T]) SelectedItemIndex ¶
func (*PopupMenu[T]) SetItems ¶
func (p *PopupMenu[T]) SetItems(items []PopupMenuItem[T])
func (*PopupMenu[T]) SetItemsByStrings ¶
func (*PopupMenu[T]) SetReservesCheckmarkSpace ¶
SetReservesCheckmarkSpace sets whether the popup menu reserves space for the checkmark column even when no item is currently checked. This keeps item widths and positions stable across check-state changes.
Items can independently toggle PopupMenuItem.Checked to render a checkmark. The column is automatically reserved when at least one item is checked, so this setter is only needed when no items are currently checked but might be in the future.
type PopupMenuItem ¶
type ProgressBar ¶
type ProgressBar struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
ProgressBar is a horizontal gauge showing how far a task has come. The gauge is empty until both the minimum and the maximum value are set.
func (*ProgressBar) Draw ¶
func (p *ProgressBar) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
func (*ProgressBar) MaximumValueBigInt ¶
func (p *ProgressBar) MaximumValueBigInt() *big.Int
func (*ProgressBar) Measure ¶
func (p *ProgressBar) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
func (*ProgressBar) MinimumValueBigInt ¶
func (p *ProgressBar) MinimumValueBigInt() *big.Int
func (*ProgressBar) SetMaximumValue ¶
func (p *ProgressBar) SetMaximumValue(maximum int)
func (*ProgressBar) SetMaximumValueBigInt ¶
func (p *ProgressBar) SetMaximumValueBigInt(maximum *big.Int)
func (*ProgressBar) SetMaximumValueInt64 ¶
func (p *ProgressBar) SetMaximumValueInt64(maximum int64)
func (*ProgressBar) SetMaximumValueUint64 ¶
func (p *ProgressBar) SetMaximumValueUint64(maximum uint64)
func (*ProgressBar) SetMinimumValue ¶
func (p *ProgressBar) SetMinimumValue(minimum int)
func (*ProgressBar) SetMinimumValueBigInt ¶
func (p *ProgressBar) SetMinimumValueBigInt(minimum *big.Int)
func (*ProgressBar) SetMinimumValueInt64 ¶
func (p *ProgressBar) SetMinimumValueInt64(minimum int64)
func (*ProgressBar) SetMinimumValueUint64 ¶
func (p *ProgressBar) SetMinimumValueUint64(minimum uint64)
func (*ProgressBar) SetValue ¶
func (p *ProgressBar) SetValue(value int)
func (*ProgressBar) SetValueBigInt ¶
func (p *ProgressBar) SetValueBigInt(value *big.Int)
func (*ProgressBar) SetValueInt64 ¶
func (p *ProgressBar) SetValueInt64(value int64)
func (*ProgressBar) SetValueUint64 ¶
func (p *ProgressBar) SetValueUint64(value uint64)
func (*ProgressBar) Value ¶
func (p *ProgressBar) Value() int
func (*ProgressBar) ValueBigInt ¶
func (p *ProgressBar) ValueBigInt() *big.Int
func (*ProgressBar) ValueInt64 ¶
func (p *ProgressBar) ValueInt64() int64
func (*ProgressBar) ValueUint64 ¶
func (p *ProgressBar) ValueUint64() uint64
func (*ProgressBar) WriteStateKey ¶
func (p *ProgressBar) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type RadioButton ¶
type RadioButton[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
RadioButton is a radio button to choose one value from a group of values.
RadioButton should not be created directly. Use RadioButtonGroup instead.
func (*RadioButton[T]) Build ¶
func (r *RadioButton[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
func (*RadioButton[T]) CursorShape ¶
func (r *RadioButton[T]) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*RadioButton[T]) Draw ¶
func (r *RadioButton[T]) Draw(context *guigui.Context, widgetBounds *guigui.WidgetBounds, dst *ebiten.Image)
func (*RadioButton[T]) HandlePointingInput ¶
func (r *RadioButton[T]) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*RadioButton[T]) Layout ¶
func (r *RadioButton[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*RadioButton[T]) Measure ¶
func (r *RadioButton[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
func (*RadioButton[T]) Tick ¶
func (r *RadioButton[T]) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
func (*RadioButton[T]) WriteStateKey ¶
func (r *RadioButton[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type RadioButtonGroup ¶
type RadioButtonGroup[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
RadioButtonGroup is a group of radio buttons.
RadioButtonGroup holds RadioButton widgets, but doesn't add them to the widget tree. The user must add the RadioButton widgets to the widget tree manually.
func (*RadioButtonGroup[T]) OnItemSelected ¶
func (r *RadioButtonGroup[T]) OnItemSelected(f func(context *guigui.Context, index int))
func (*RadioButtonGroup[T]) RadioButton ¶
func (r *RadioButtonGroup[T]) RadioButton(index int) *RadioButton[T]
RadioButton returns the radio button at the specified index.
func (*RadioButtonGroup[T]) SelectItemByIndex ¶
func (r *RadioButtonGroup[T]) SelectItemByIndex(index int)
func (*RadioButtonGroup[T]) SelectItemByValue ¶
func (r *RadioButtonGroup[T]) SelectItemByValue(value T)
func (*RadioButtonGroup[T]) SelectedIndex ¶
func (r *RadioButtonGroup[T]) SelectedIndex() int
func (*RadioButtonGroup[T]) SelectedValue ¶
func (r *RadioButtonGroup[T]) SelectedValue() (T, bool)
func (*RadioButtonGroup[T]) SetValues ¶
func (r *RadioButtonGroup[T]) SetValues(values []T)
SetValues sets the values of the radio buttons. The length of the values slice determines the number of radio buttons.
func (*RadioButtonGroup[T]) WriteStateKey ¶
func (r *RadioButtonGroup[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type SegmentedControl ¶
type SegmentedControl[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
func (*SegmentedControl[T]) AppendSelectedItemIndices ¶
func (s *SegmentedControl[T]) AppendSelectedItemIndices(indices []int) []int
func (*SegmentedControl[T]) Build ¶
func (s *SegmentedControl[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error
func (*SegmentedControl[T]) ItemByIndex ¶
func (s *SegmentedControl[T]) ItemByIndex(index int) (SegmentedControlItem[T], bool)
func (*SegmentedControl[T]) Layout ¶
func (s *SegmentedControl[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*SegmentedControl[T]) Measure ¶
func (s *SegmentedControl[T]) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
func (*SegmentedControl[T]) OnItemSelected ¶
func (s *SegmentedControl[T]) OnItemSelected(f func(context *guigui.Context, index int))
func (*SegmentedControl[T]) OnItemsSelected ¶
func (s *SegmentedControl[T]) OnItemsSelected(f func(context *guigui.Context, indices []int))
func (*SegmentedControl[T]) SelectItemByIndex ¶
func (s *SegmentedControl[T]) SelectItemByIndex(index int)
func (*SegmentedControl[T]) SelectItemByValue ¶
func (s *SegmentedControl[T]) SelectItemByValue(value T)
func (*SegmentedControl[T]) SelectItemsByIndices ¶
func (s *SegmentedControl[T]) SelectItemsByIndices(indices []int)
func (*SegmentedControl[T]) SelectItemsByValues ¶
func (s *SegmentedControl[T]) SelectItemsByValues(values []T)
func (*SegmentedControl[T]) SelectedItem ¶
func (s *SegmentedControl[T]) SelectedItem() (SegmentedControlItem[T], bool)
func (*SegmentedControl[T]) SelectedItemCount ¶
func (s *SegmentedControl[T]) SelectedItemCount() int
func (*SegmentedControl[T]) SelectedItemIndex ¶
func (s *SegmentedControl[T]) SelectedItemIndex() int
func (*SegmentedControl[T]) SetDirection ¶
func (s *SegmentedControl[T]) SetDirection(direction SegmentedControlDirection)
func (*SegmentedControl[T]) SetItems ¶
func (s *SegmentedControl[T]) SetItems(items []SegmentedControlItem[T])
func (*SegmentedControl[T]) SetMultiSelection ¶
func (s *SegmentedControl[T]) SetMultiSelection(multi bool)
func (*SegmentedControl[T]) WriteStateKey ¶
func (s *SegmentedControl[T]) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type SegmentedControlDirection ¶
type SegmentedControlDirection int
const ( SegmentedControlDirectionHorizontal SegmentedControlDirection = iota SegmentedControlDirectionVertical )
type SegmentedControlItem ¶
type Select ¶
type Select[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
func (*Select[T]) IsPopupOpen ¶
func (*Select[T]) ItemByIndex ¶
func (s *Select[T]) ItemByIndex(index int) (SelectItem[T], bool)
func (*Select[T]) Layout ¶
func (s *Select[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Select[T]) OnItemSelected ¶
func (*Select[T]) SelectItemByIndex ¶
func (*Select[T]) SelectItemByValue ¶
func (s *Select[T]) SelectItemByValue(value T)
func (*Select[T]) SelectedItem ¶
func (s *Select[T]) SelectedItem() (SelectItem[T], bool)
func (*Select[T]) SelectedItemIndex ¶
func (*Select[T]) SetItems ¶
func (s *Select[T]) SetItems(items []SelectItem[T])
func (*Select[T]) SetItemsByStrings ¶
type SelectItem ¶
type SelectItem[T comparable] struct { Text string TextStyle ItemTextStyle Header bool Content guigui.Widget Unselectable bool Border bool Disabled bool Value T }
type Slider ¶
type Slider struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Slider) CursorShape ¶
func (s *Slider) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*Slider) HandlePointingInput ¶
func (s *Slider) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*Slider) MaximumValueBigInt ¶
func (*Slider) MinimumValueBigInt ¶
func (*Slider) OnValueChanged ¶
func (*Slider) OnValueChangedBigInt ¶
func (*Slider) OnValueChangedInt64 ¶
func (*Slider) OnValueChangedUint64 ¶
func (*Slider) SetMaximumValue ¶
func (*Slider) SetMaximumValueBigInt ¶
func (*Slider) SetMaximumValueInt64 ¶
func (*Slider) SetMaximumValueUint64 ¶
func (*Slider) SetMinimumValue ¶
func (*Slider) SetMinimumValueBigInt ¶
func (*Slider) SetMinimumValueInt64 ¶
func (*Slider) SetMinimumValueUint64 ¶
func (*Slider) SetSnapOnly ¶
func (*Slider) SetStepBigInt ¶
func (*Slider) SetStepInt64 ¶
func (*Slider) SetStepUint64 ¶
func (*Slider) SetValueBigInt ¶
func (*Slider) SetValueInt64 ¶
func (*Slider) SetValueUint64 ¶
func (*Slider) ValueBigInt ¶
func (*Slider) ValueInt64 ¶
func (*Slider) ValueUint64 ¶
func (*Slider) WriteStateKey ¶
func (s *Slider) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type Table ¶
type Table[T comparable] struct { guigui.DefaultWidget // contains filtered or unexported fields }
func (*Table[T]) AppendSelectedItemIndices ¶
func (*Table[T]) CellBounds ¶
CellBounds returns the bounds for the cell at the given row and column indices. CellBounds is valid only after the table's layout finishes.
func (*Table[T]) EnsureItemVisibleByIndex ¶
func (*Table[T]) ForceEnsureItemVisibleByIndex ¶
func (*Table[T]) ForceSetScrollPosition ¶
func (t *Table[T]) ForceSetScrollPosition(position ListScrollPosition)
ForceSetScrollPosition scrolls to the given position without animation.
func (*Table[T]) IndexByValue ¶
func (*Table[T]) IsItemAvailable ¶
IsItemAvailable reports whether the item at the given index is available in the list (i.e., not hidden by a collapsed ancestor).
func (*Table[T]) IsItemInViewport ¶
func (*Table[T]) JumpToItemByIndex ¶
func (*Table[T]) Layout ¶
func (t *Table[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Table[T]) OnItemSelected ¶
func (*Table[T]) OnItemsCanMove ¶
func (*Table[T]) OnItemsMoved ¶
func (*Table[T]) OnItemsSelected ¶
func (*Table[T]) OnScroll ¶
func (t *Table[T]) OnScroll(callback func(context *guigui.Context, position ListScrollPosition))
OnScroll sets the handler invoked when the scroll position changes.
func (*Table[T]) ScrollPosition ¶
func (t *Table[T]) ScrollPosition() ListScrollPosition
ScrollPosition returns a snapshot of the current scroll position, restorable with Table.SetScrollPosition or Table.ForceSetScrollPosition.
func (*Table[T]) SelectAllItems ¶
func (t *Table[T]) SelectAllItems()
func (*Table[T]) SelectItemByIndex ¶
func (*Table[T]) SelectItemByValue ¶
func (t *Table[T]) SelectItemByValue(value T)
func (*Table[T]) SelectItemsByIndices ¶
func (*Table[T]) SelectItemsByValues ¶
func (t *Table[T]) SelectItemsByValues(values []T)
func (*Table[T]) SelectedItem ¶
func (*Table[T]) SelectedItemCount ¶
func (*Table[T]) SelectedItemIndex ¶
func (*Table[T]) SetColumns ¶
func (t *Table[T]) SetColumns(columns []TableColumn)
func (*Table[T]) SetFooterHeight ¶
func (*Table[T]) SetItemHeight ¶
func (*Table[T]) SetMultiSelection ¶
func (*Table[T]) SetReservesCheckmarkSpace ¶
SetReservesCheckmarkSpace sets whether the table reserves space for the checkmark column even when no row is currently checked. See List.SetReservesCheckmarkSpace for details.
func (*Table[T]) SetScrollPosition ¶
func (t *Table[T]) SetScrollPosition(position ListScrollPosition)
SetScrollPosition scrolls to the given position with animation.
func (*Table[T]) SetUnfocusedSelectionVisible ¶
type TableCell ¶
type TableCell struct {
Text string
TextStyle ItemTextStyle
Content guigui.Widget
}
type TableColumn ¶
type TableColumn struct {
HeaderText string
HeaderTextHorizontalAlign HorizontalAlign
Width guigui.Size
MinWidth int
}
type TableRow ¶
type TableRow[T comparable] struct { Cells []TableCell Unselectable bool Movable bool Checked bool Value T }
type Text ¶
type Text struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
Text is a widget that shows or edits a text value. It wraps the theme-free textwidget.Text core with theme policy: the default text colors, font family resolution, locales, and the placeholder.
func (*Text) AppendBoundsOfTextRange ¶
func (t *Text) AppendBoundsOfTextRange(dst []image.Rectangle, context *guigui.Context, bounds image.Rectangle, startInBytes, endInBytes int) []image.Rectangle
AppendBoundsOfTextRange appends the bounding rectangles covering the text range [startInBytes, endInBytes) to dst and returns the extended slice, one rectangle per crossed visual line, in order. bounds is the widget's bounds; the rectangles are in the same coordinate space. A masked value appends nothing. Endpoints outside the text are clamped.
func (*Text) AppendHotspotRanges ¶
AppendHotspotRanges appends the current hotspot ranges to dst and returns the extended slice, reflecting the adjustments made for edits since Text.SetHotspotRanges.
func (*Text) CaretPositionAtTextIndexInBytes ¶
func (t *Text) CaretPositionAtTextIndexInBytes(context *guigui.Context, textIndexInBytes int) (top, bottom image.Point, ok bool)
CaretPositionAtTextIndexInBytes returns the on-screen top and bottom endpoints of a caret drawn at byte offset textIndexInBytes in the text value. ok is false when textIndexInBytes is out of range, or when the caret's logical line is outside the current viewport.
CaretPositionAtTextIndexInBytes is available after the layout phase.
func (*Text) CommitWithCurrentInputValue ¶
func (t *Text) CommitWithCurrentInputValue()
func (*Text) ForceSetValue ¶
func (*Text) HasValue ¶
HasValue reports whether the text has a non-empty value. This is more efficient than checking Value() != "" as it avoids allocating a string.
func (*Text) HorizontalAlign ¶
func (t *Text) HorizontalAlign() HorizontalAlign
func (*Text) IsEditable ¶
func (*Text) IsMultiline ¶
IsMultiline reports whether the value may span multiple lines. It is always false while masking, which is single-line.
func (*Text) Layout ¶
func (t *Text) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*Text) LineCount ¶
LineCount returns the number of logical lines in the value. A logical line is a span between hard line breaks; soft-wrapped visual lines are not counted. The empty value has one logical line; a trailing line break creates an extra empty line at the end, so "abc\n" has 2 lines.
func (*Text) LineIndexFromTextIndexInBytes ¶
LineIndexFromTextIndexInBytes returns the index of the logical line containing textIndexInBytes. textIndexInBytes is clamped: negative values map to line 0, values past the end map to the last line.
See Text.LineCount for what counts as a logical line.
func (*Text) LineStartInBytes ¶
LineStartInBytes returns the byte offset where the lineIndex-th logical line begins within the value. lineIndex must be in [0, Text.LineCount).
func (*Text) OnHandleButtonInput ¶
func (t *Text) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)
func (*Text) OnHotspotDown ¶
OnHotspotDown sets the event handler that is called when the left mouse button is pressed on a hotspot range. The handler is given the pressed range.
func (*Text) OnHotspotUp ¶
OnHotspotUp sets the event handler that is called when the left mouse button is released on the hotspot range it was pressed on. For selectable text, the click is canceled when the cursor moved or a selection was made between the press and the release: a drag selects, it does not click. The handler is given the released range.
func (*Text) OnInsertionStyleReset ¶
OnInsertionStyleReset sets an event handler invoked when the widget resets the insertion style: after applying it to inserted text, or when discarding it without applying, such as on a selection change. The handler is not invoked for Text.SetInsertionStyle.
func (*Text) OnValueChanged ¶
OnValueChanged sets the event handler that is called when the text value changes. The handler receives the current text and whether the change is committed. A committed change is a finalized value: the user presses Enter (for single-line text), the text input loses focus, or the value is set programmatically via Text.ForceSetValue / Text.ReadValueFrom (and equivalent paths on wrapping widgets). An uncommitted change is a mid-flight edit such as IME composition.
Pressing Enter on single-line text always dispatches a committed change, even when the value equals the last committed value. Every other path fires only when the text content actually advances: input activity that doesn't modify the text — caret moves, focus changes, IME state replays, a focus-loss commit on an unchanged buffer — does not trigger the handler.
An undo or redo also dispatches an uncommitted change when it restores the ranged style overrides alone, with the text itself unchanged. The handler can read the current overrides back via Text.ReadOverrideStyles.
If the handler does not need the text payload, prefer Text.OnValueChangedWithoutText to avoid materializing the value on every change.
func (*Text) OnValueChangedWithoutText ¶
OnValueChangedWithoutText sets a handler that fires under the same conditions as Text.OnValueChanged but is not given the current text. Use this when the handler only needs to know that the value changed (e.g. to mark a document dirty) so the underlying value is not materialized into a string on every change.
The handler can be registered alongside Text.OnValueChanged; both fire on the same change.
func (*Text) PasteWithoutStyles ¶
PasteWithoutStyles pastes the clipboard text without the ranged styles copied along with it, even when the widget is rich text editable. The inserted text adopts the style of the surrounding text.
func (*Text) ReadBaseStyle ¶
ReadBaseStyle replaces style with the base style: the style properties applied to the whole value, underneath the ranged style overrides. A property is unset when the theme default applies.
func (*Text) ReadEffectiveStyleAt ¶
ReadEffectiveStyleAt replaces style with the effective style that text typed at textIndexInBytes adopts: the base style and the rendering defaults with the overrides adopted from the byte right before the index merged on top, so every property is set.
func (*Text) ReadEffectiveStyles ¶
func (t *Text) ReadEffectiveStyles(styles *TextStyles)
ReadEffectiveStyles replaces styles with the effective styles of the whole value. The effective style of a byte is the base style and the rendering defaults with the byte's ranged overrides merged on top, so every property is set.
func (*Text) ReadEffectiveStylesInRange ¶
func (t *Text) ReadEffectiveStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
ReadEffectiveStylesInRange replaces styles with the effective styles of [startInBytes, endInBytes), rebased so that startInBytes maps to 0. The effective style of a byte is the base style and the rendering defaults with the byte's ranged overrides merged on top, so every property is set.
func (*Text) ReadOverrideStyles ¶
func (t *Text) ReadOverrideStyles(styles *TextStyles)
ReadOverrideStyles replaces styles with a copy of the ranged style overrides, reflecting the adjustments made for edits since the overrides were set.
func (*Text) ReadOverrideStylesInRange ¶
func (t *Text) ReadOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
ReadOverrideStylesInRange replaces styles with a copy of the ranged style overrides in [startInBytes, endInBytes), rebased so that startInBytes maps to 0.
func (*Text) ReadValueFrom ¶
ReadValueFrom resets the value to the bytes read from r until EOF and returns the number of bytes read. It is the streaming counterpart of Text.ForceSetValue: the change is applied immediately, the undo history is cleared, and the selection is reset to (0, 0).
If r returns a non-EOF error, the value is reset to empty and the error is returned.
func (*Text) ReplaceValueAtSelection ¶
func (*Text) SetBaseStyle ¶
SetBaseStyle replaces the base style with style. Unset properties restore the theme defaults. The base style holds the font family, the italic face selection, OpenType variations and features (including the weight), and the text color; the scale and the language are ignored, as they come from Text.SetScale and Text.SetLocales.
func (*Text) SetCaretBlinking ¶
SetCaretBlinking sets whether the caret blinks. The default value is true.
func (*Text) SetEditable ¶
func (*Text) SetEllipsisString ¶
func (*Text) SetFontSize ¶
SetFontSize sets the font size at scale 1. A non-positive size selects the default font size (FontSize). Unlike the default, the specified size is not multiplied by guigui.Context.Scale, so it can express a size independent of the app scale; multiply it explicitly when it should follow the app scale.
func (*Text) SetHorizontalAlign ¶
func (t *Text) SetHorizontalAlign(align HorizontalAlign)
func (*Text) SetHotspotRanges ¶
SetHotspotRanges sets the hotspot ranges: over their rectangles the cursor turns into a pointer, and mouse presses and releases fire the hotspot down and up events. The ranges follow the text through edits like the ranged styles. While the value is editable, the hotspots are inert.
func (*Text) SetInsertionStyle ¶
SetInsertionStyle replaces the insertion style with style. Its set properties are applied as ranged style overrides over the next text inserted at the caret, on top of the adopted overrides, and the style is then reset. The widget also resets it without applying on other interactions, such as a selection change, a deletion, or an undo; neither setting nor resetting is recorded in the undo history. SetInsertionStyle is typically called on every build with application-owned state, updated in the Text.OnInsertionStyleReset handler so the next build sets the cleared style.
func (*Text) SetLineHeight ¶
SetLineHeight sets the line height at scale 1. A non-positive height selects the default line height (LineHeight). Unlike the default, the specified height is not multiplied by guigui.Context.Scale, so it can express a height independent of the app scale; multiply it explicitly when it should follow the app scale.
func (*Text) SetLineHeightMode ¶
func (t *Text) SetLineHeightMode(lineHeightMode LineHeightMode)
SetLineHeightMode sets how a visual line's height responds to the font sizes on it. The default is LineHeightModeFixed.
func (*Text) SetLocales ¶
func (*Text) SetMaskRune ¶
SetMaskRune sets the character drawn in place of each grapheme cluster of the value. A non-zero rune masks the text and forces it to a single line; the zero value renders it normally.
func (*Text) SetMultiline ¶
func (*Text) SetOpacity ¶
func (*Text) SetOverrideStyles ¶
func (t *Text) SetOverrideStyles(styles *TextStyles, recorded bool)
SetOverrideStyles replaces the ranged style overrides with styles. recorded sets whether the replacement is recorded in the undo history; a recorded replacement leaving the overrides unchanged records nothing. Pass false when restoring the overrides from a model, such as on every build.
func (*Text) SetOverrideStylesInRange ¶
func (t *Text) SetOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int, recorded bool)
SetOverrideStylesInRange replaces the ranged style overrides in [startInBytes, endInBytes) with styles' overrides in [0, endInBytes-startInBytes), shifted so that 0 maps to startInBytes. styles' overrides outside [0, endInBytes-startInBytes) are ignored. recorded sets whether the replacement is recorded in the undo history; a recorded replacement leaving the overrides unchanged records nothing.
func (*Text) SetPlaceholder ¶
SetPlaceholder sets the placeholder text shown in a subdued color while the value is empty and the text is editable. The empty string disables the placeholder.
func (*Text) SetRichTextEditable ¶
SetRichTextEditable sets whether pasting applies the ranged styles copied along with the text. The default is false: pasting inserts plain text and the inserted text adopts the style of the surrounding text.
func (*Text) SetSelectable ¶
func (*Text) SetSelection ¶
SetSelection sets the selection to [start, end) in bytes. Offsets inside a UTF-8 sequence are snapped to rune boundaries: an empty selection moves to the start of the rune containing it, and a non-empty one expands to cover whole runes.
func (*Text) SetSelectionVisibleWhenUnfocused ¶
SetSelectionVisibleWhenUnfocused sets whether the selection range stays drawn while the widget is not focused. By default the selection is hidden when the widget loses focus. Enable this when a separate UI (e.g. a Find dialog) holds focus but the user still needs to see what was matched.
func (*Text) SetTabWidth ¶
func (*Text) SetVerticalAlign ¶
func (t *Text) SetVerticalAlign(align VerticalAlign)
func (*Text) SetWrapMode ¶
SetWrapMode selects how visual lines wrap when text exceeds the available width. See WrapMode for the available modes.
func (*Text) Value ¶
Value returns the current value as a string. For large values, prefer Text.WriteValueTo to avoid allocating a copy.
func (*Text) VerticalAlign ¶
func (t *Text) VerticalAlign() VerticalAlign
func (*Text) WrapMode ¶
WrapMode reports how visual lines wrap when text exceeds the available width. The default is WrapModeNone.
func (*Text) WriteStateKey ¶
func (t *Text) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
func (*Text) WriteValueRangeTo ¶
WriteValueRangeTo writes the bytes of the current value in [startInBytes, endInBytes) to w. startInBytes and endInBytes are clamped to [0, len(value)]. If the clamped start is not less than the clamped end, nothing is written.
func (*Text) WriteValueTo ¶
WriteValueTo writes the current value to w and returns the number of bytes written. It is the streaming counterpart of Text.Value and avoids materializing the full value as a string.
type TextInput ¶
type TextInput struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*TextInput) CaretPositionAtTextIndexInBytes ¶
func (t *TextInput) CaretPositionAtTextIndexInBytes(context *guigui.Context, textIndexInBytes int) (top, bottom image.Point, ok bool)
CaretPositionAtTextIndexInBytes returns the on-screen top and bottom endpoints of a caret drawn at byte offset textIndexInBytes in the text value. See Text.CaretPositionAtTextIndexInBytes for details.
func (*TextInput) CommitWithCurrentInputValue ¶
func (t *TextInput) CommitWithCurrentInputValue()
func (*TextInput) ForceSetValue ¶
func (*TextInput) HasValue ¶
HasValue reports whether the text input has a non-empty value. This is more efficient than checking Value() != "" as it avoids allocating a string.
func (*TextInput) IsEditable ¶
func (*TextInput) Layout ¶
func (t *TextInput) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
func (*TextInput) LineCount ¶
LineCount returns the number of logical lines in the value. See Text.LineCount for details.
func (*TextInput) LineIndexFromTextIndexInBytes ¶
LineIndexFromTextIndexInBytes returns the index of the logical line containing textIndexInBytes. See Text.LineIndexFromTextIndexInBytes for details.
func (*TextInput) LineStartInBytes ¶
LineStartInBytes returns the byte offset where the lineIndex-th logical line begins within the value. See Text.LineStartInBytes for details.
func (*TextInput) OnHandleButtonInput ¶
func (t *TextInput) OnHandleButtonInput(f func(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult)
func (*TextInput) OnInsertionStyleReset ¶
OnInsertionStyleReset sets an event handler invoked when the widget resets the insertion style: after applying it to inserted text, or when discarding it without applying, such as on a selection change. The handler is not invoked for TextInput.SetInsertionStyle.
func (*TextInput) OnValueChanged ¶
OnValueChanged sets a handler with the same dispatch and commit semantics as Text.OnValueChanged. The handler receives the current text and whether the change is committed.
If the handler does not need the text payload, prefer TextInput.OnValueChangedWithoutText to avoid materializing the value on every change.
func (*TextInput) OnValueChangedWithoutText ¶
OnValueChangedWithoutText sets a handler that fires under the same conditions as TextInput.OnValueChanged but is not given the current text. Use this when the handler only needs to know that the value changed so the underlying value is not materialized into a string on every change.
func (*TextInput) PasteWithoutStyles ¶
PasteWithoutStyles pastes the clipboard text without the ranged styles copied along with it, even when the widget is rich text editable. The inserted text adopts the style of the surrounding text.
func (*TextInput) ReadBaseStyle ¶
ReadBaseStyle replaces style with the base style: the style properties applied to the whole value, underneath the ranged style overrides. A property is unset when the theme default applies.
func (*TextInput) ReadEffectiveStyleAt ¶
ReadEffectiveStyleAt replaces style with the effective style that text typed at textIndexInBytes adopts: the base style and the rendering defaults with the overrides adopted from the byte right before the index merged on top, so every property is set.
func (*TextInput) ReadEffectiveStyles ¶
func (t *TextInput) ReadEffectiveStyles(styles *TextStyles)
ReadEffectiveStyles replaces styles with the effective styles of the whole value. The effective style of a byte is the base style and the rendering defaults with the byte's ranged overrides merged on top, so every property is set.
func (*TextInput) ReadEffectiveStylesInRange ¶
func (t *TextInput) ReadEffectiveStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
ReadEffectiveStylesInRange replaces styles with the effective styles of [startInBytes, endInBytes), rebased so that startInBytes maps to 0. The effective style of a byte is the base style and the rendering defaults with the byte's ranged overrides merged on top, so every property is set.
func (*TextInput) ReadOverrideStyles ¶
func (t *TextInput) ReadOverrideStyles(styles *TextStyles)
ReadOverrideStyles replaces styles with a copy of the ranged style overrides, reflecting the adjustments made for edits since the overrides were set.
func (*TextInput) ReadOverrideStylesInRange ¶
func (t *TextInput) ReadOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int)
ReadOverrideStylesInRange replaces styles with a copy of the ranged style overrides in [startInBytes, endInBytes), rebased so that startInBytes maps to 0.
func (*TextInput) ReadValueFrom ¶
ReadValueFrom resets the value to the bytes read from r until EOF. See Text.ReadValueFrom for details.
func (*TextInput) ReplaceValueAtSelection ¶
func (*TextInput) SetBaseStyle ¶
SetBaseStyle replaces the base style with style. Unset properties restore the theme defaults. The base style holds the font family, the italic face selection, OpenType variations and features (including the weight), and the text color; the scale and the language are ignored.
func (*TextInput) SetCaretBlinking ¶
SetCaretBlinking sets whether the caret blinks. The default value is true.
func (*TextInput) SetEditable ¶
func (*TextInput) SetError ¶
SetError sets whether the text input is in the error state. When the error state is true, the text input border is drawn in a danger color.
func (*TextInput) SetFocusBorderVisible ¶
SetFocusBorderVisible sets whether the focus border is drawn around the text input when it has focus. The default is true.
func (*TextInput) SetHorizontalAlign ¶
func (t *TextInput) SetHorizontalAlign(halign HorizontalAlign)
func (*TextInput) SetInsertionStyle ¶
SetInsertionStyle replaces the insertion style with style. Its set properties are applied as ranged style overrides over the next text inserted at the caret, on top of the adopted overrides, and the style is then reset. The widget also resets it without applying on other interactions, such as a selection change, a deletion, or an undo; neither setting nor resetting is recorded in the undo history. SetInsertionStyle is typically called on every build with application-owned state, updated in the TextInput.OnInsertionStyleReset handler so the next build sets the cleared style.
func (*TextInput) SetLineHeight ¶
SetLineHeight sets the line height at scale 1. See Text.SetLineHeight for details.
func (*TextInput) SetLineHeightMode ¶
func (t *TextInput) SetLineHeightMode(lineHeightMode LineHeightMode)
SetLineHeightMode sets how a visual line's height responds to the font sizes on it. The default is LineHeightModeFixed.
func (*TextInput) SetMaskRune ¶
SetMaskRune sets the character drawn in place of each grapheme cluster of the value, masking it for password-style entry. A non-zero rune also disables copy and cut and forces the input to a single line; the zero value restores normal text.
func (*TextInput) SetMultiline ¶
func (*TextInput) SetOverrideStyles ¶
func (t *TextInput) SetOverrideStyles(styles *TextStyles, recorded bool)
SetOverrideStyles replaces the ranged style overrides with styles. recorded sets whether the replacement is recorded in the undo history; a recorded replacement leaving the overrides unchanged records nothing. Pass false when restoring the overrides from a model, such as on every build.
func (*TextInput) SetOverrideStylesInRange ¶
func (t *TextInput) SetOverrideStylesInRange(styles *TextStyles, startInBytes, endInBytes int, recorded bool)
SetOverrideStylesInRange replaces the ranged style overrides in [startInBytes, endInBytes) with styles' overrides in [0, endInBytes-startInBytes), shifted so that 0 maps to startInBytes. styles' overrides outside [0, endInBytes-startInBytes) are ignored. recorded sets whether the replacement is recorded in the undo history; a recorded replacement leaving the overrides unchanged records nothing.
func (*TextInput) SetPlaceholder ¶
SetPlaceholder sets the placeholder text shown in a subdued color while the value is empty and the text input is editable. The empty string disables the placeholder.
func (*TextInput) SetRichTextEditable ¶
SetRichTextEditable sets whether pasting applies the ranged styles copied along with the text. The default is false: pasting inserts plain text and the inserted text adopts the style of the surrounding text.
func (*TextInput) SetSelection ¶
SetSelection sets the selection to [start, end) in bytes. Offsets inside a UTF-8 sequence are snapped to rune boundaries: an empty selection moves to the start of the rune containing it, and a non-empty one expands to cover whole runes.
func (*TextInput) SetSelectionVisibleWhenUnfocused ¶
SetSelectionVisibleWhenUnfocused sets whether the selection range stays drawn while the widget is not focused. By default the selection is hidden when the widget loses focus.
func (*TextInput) SetStyle ¶
func (t *TextInput) SetStyle(style TextInputStyle)
SetStyle applies the preset combination of orthogonal properties for the given style. SetStyle re-applies every property on each call, so a per-property override takes effect only when its setter is called after SetStyle.
func (*TextInput) SetSupportText ¶
SetSupportText sets the support text displayed below the text input. The support text is shown in a subdued color, or in a danger color when the error state is true. A line break starts a new line.
func (*TextInput) SetVerticalAlign ¶
func (t *TextInput) SetVerticalAlign(valign VerticalAlign)
func (*TextInput) SetWrapMode ¶
SetWrapMode sets how visual lines wrap when text exceeds the available width. See WrapMode for the available modes.
func (*TextInput) SupportText ¶
SupportText returns the support text displayed below the text input.
func (*TextInput) Value ¶
Value returns the current value as a string. For large values, prefer TextInput.WriteValueTo to avoid allocating a copy.
func (*TextInput) WriteStateKey ¶
func (t *TextInput) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
func (*TextInput) WriteValueRangeTo ¶
WriteValueRangeTo writes the bytes of the current value in [startInBytes, endInBytes) to w. See Text.WriteValueRangeTo for details.
func (*TextInput) WriteValueTo ¶
WriteValueTo writes the current value to w and returns the number of bytes written. See Text.WriteValueTo for details.
type TextInputStyle ¶
type TextInputStyle int
const ( TextInputStyleNormal TextInputStyle = iota TextInputStyleInline )
type TextRange ¶
type TextRange struct {
// StartInBytes is the inclusive start of the range in bytes.
StartInBytes int
// EndInBytes is the exclusive end of the range in bytes.
EndInBytes int
}
TextRange is a byte range of a text value.
type TextStyle ¶
type TextStyle struct {
// contains filtered or unexported fields
}
TextStyle is a set of text style properties where each property is individually set or unset. The zero value has every property unset. A TextStyle carries a widget's base style through Text.ReadBaseStyle and Text.SetBaseStyle, and an effective style through Text.ReadEffectiveStyleAt.
func (*TextStyle) BackgroundColor ¶
BackgroundColor returns the background color and whether it is set.
func (*TextStyle) Feature ¶
Feature returns the value of the OpenType feature tag and whether it is set.
func (*TextStyle) FontFamily ¶
func (s *TextStyle) FontFamily() (*FontFamily, bool)
FontFamily returns the font family and whether it is set.
func (*TextStyle) SetBackgroundColor ¶
SetBackgroundColor sets the background color.
func (*TextStyle) SetBold ¶
SetBold sets the font weight to the bold or the medium weight by setting the wght variation axis. Use TextStyle.UnsetWeight to unset the weight and TextStyle.Weight to read it back.
func (*TextStyle) SetFeature ¶
SetFeature sets the OpenType feature tag to value.
func (*TextStyle) SetFontFamily ¶
func (s *TextStyle) SetFontFamily(family *FontFamily)
SetFontFamily sets the font family. A nil family renders with the registered face source stack alone.
func (*TextStyle) SetStrikethrough ¶
SetStrikethrough sets whether a strikethrough is drawn.
func (*TextStyle) SetTabular ¶
SetTabular sets whether the digits are rendered with a uniform advance by setting the tnum OpenType feature.
func (*TextStyle) SetUnderline ¶
SetUnderline sets whether an underline is drawn.
func (*TextStyle) SetVariation ¶
SetVariation sets the OpenType variation axis tag to value.
func (*TextStyle) Strikethrough ¶
Strikethrough returns whether a strikethrough is drawn and whether the property is set.
func (*TextStyle) Tabular ¶
Tabular returns whether the digits are rendered with a uniform advance, the value of the tnum OpenType feature, and whether it is set.
func (*TextStyle) Underline ¶
Underline returns whether an underline is drawn and whether the property is set.
func (*TextStyle) UnsetBackgroundColor ¶
func (s *TextStyle) UnsetBackgroundColor()
UnsetBackgroundColor unsets the background color.
func (*TextStyle) UnsetFeature ¶
UnsetFeature unsets the OpenType feature tag.
func (*TextStyle) UnsetFontFamily ¶
func (s *TextStyle) UnsetFontFamily()
UnsetFontFamily unsets the font family.
func (*TextStyle) UnsetItalic ¶
func (s *TextStyle) UnsetItalic()
UnsetItalic unsets the italic face selection.
func (*TextStyle) UnsetLang ¶
func (s *TextStyle) UnsetLang()
UnsetLang unsets the language used for rendering.
func (*TextStyle) UnsetScale ¶
func (s *TextStyle) UnsetScale()
UnsetScale unsets the multiplier of the font size.
func (*TextStyle) UnsetStrikethrough ¶
func (s *TextStyle) UnsetStrikethrough()
UnsetStrikethrough unsets whether a strikethrough is drawn.
func (*TextStyle) UnsetTabular ¶
func (s *TextStyle) UnsetTabular()
UnsetTabular unsets whether the digits are rendered with a uniform advance by unsetting the tnum OpenType feature.
func (*TextStyle) UnsetUnderline ¶
func (s *TextStyle) UnsetUnderline()
UnsetUnderline unsets whether an underline is drawn.
func (*TextStyle) UnsetVariation ¶
UnsetVariation unsets the OpenType variation axis tag.
func (*TextStyle) UnsetWeight ¶
func (s *TextStyle) UnsetWeight()
UnsetWeight unsets the font weight by unsetting the wght variation axis.
type TextStyles ¶
type TextStyles struct {
// contains filtered or unexported fields
}
TextStyles is a set of ranged style overrides for a Text value. The zero value is an empty set ready for use. A set built with the Set* methods is applied to a widget with Text.SetOverrideStyles or Text.SetOverrideStylesInRange; Text.ReadOverrideStyles and Text.ReadOverrideStylesInRange read a widget's current overrides back.
func (*TextStyles) ColorInRange ¶
func (s *TextStyles) ColorInRange(startInBytes, endInBytes int, fallback color.Color) (clr color.Color, uniform bool)
ColorInRange returns the text color every byte of [startInBytes, endInBytes) takes and whether the color is uniform. A byte with a color override takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
func (*TextStyles) ItalicInRange ¶
func (s *TextStyles) ItalicInRange(startInBytes, endInBytes int, fallback bool) (italic, uniform bool)
ItalicInRange returns the italic state every byte of [startInBytes, endInBytes) takes and whether the state is uniform. A byte with an italic override takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
func (*TextStyles) ResetStylesInRange ¶
func (s *TextStyles) ResetStylesInRange(startInBytes, endInBytes int)
ResetStylesInRange removes all style overrides in [startInBytes, endInBytes).
func (*TextStyles) ScaleInRange ¶
func (s *TextStyles) ScaleInRange(startInBytes, endInBytes int, fallback float64) (scale float64, uniform bool)
ScaleInRange returns the font size multiplier every byte of [startInBytes, endInBytes) takes and whether the multiplier is uniform. A byte with a scale override takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
func (*TextStyles) SetBackgroundColorInRange ¶
func (s *TextStyles) SetBackgroundColorInRange(startInBytes, endInBytes int, clr color.Color)
SetBackgroundColorInRange overrides the background color in [startInBytes, endInBytes).
func (*TextStyles) SetColorInRange ¶
func (s *TextStyles) SetColorInRange(startInBytes, endInBytes int, clr color.Color)
SetColorInRange overrides the text color in [startInBytes, endInBytes).
func (*TextStyles) SetFeatureInRange ¶
func (s *TextStyles) SetFeatureInRange(startInBytes, endInBytes int, tag text.Tag, value uint32)
SetFeatureInRange overrides the OpenType feature tag in [startInBytes, endInBytes) with value.
func (*TextStyles) SetFontFamilyInRange ¶
func (s *TextStyles) SetFontFamilyInRange(startInBytes, endInBytes int, family *FontFamily)
SetFontFamilyInRange overrides the font family in [startInBytes, endInBytes). A nil family renders the range with the registered face source stack alone.
func (*TextStyles) SetItalicInRange ¶
func (s *TextStyles) SetItalicInRange(startInBytes, endInBytes int, italic bool)
SetItalicInRange overrides the italic face selection in [startInBytes, endInBytes).
func (*TextStyles) SetLangInRange ¶
func (s *TextStyles) SetLangInRange(startInBytes, endInBytes int, lang language.Tag)
SetLangInRange overrides the language used for rendering in [startInBytes, endInBytes).
func (*TextStyles) SetScaleInRange ¶
func (s *TextStyles) SetScaleInRange(startInBytes, endInBytes int, scale float64)
SetScaleInRange overrides the multiplier of the font size in [startInBytes, endInBytes). scale must be positive.
func (*TextStyles) SetStrikethroughInRange ¶
func (s *TextStyles) SetStrikethroughInRange(startInBytes, endInBytes int, strikethrough bool)
SetStrikethroughInRange overrides whether a strikethrough is drawn in [startInBytes, endInBytes).
func (*TextStyles) SetUnderlineInRange ¶
func (s *TextStyles) SetUnderlineInRange(startInBytes, endInBytes int, underline bool)
SetUnderlineInRange overrides whether an underline is drawn in [startInBytes, endInBytes).
func (*TextStyles) SetVariationInRange ¶
func (s *TextStyles) SetVariationInRange(startInBytes, endInBytes int, tag text.Tag, value float32)
SetVariationInRange overrides the OpenType variation axis tag in [startInBytes, endInBytes) with value.
func (*TextStyles) SetWeightInRange ¶
func (s *TextStyles) SetWeightInRange(startInBytes, endInBytes int, weight text.Weight)
SetWeightInRange overrides the font weight in [startInBytes, endInBytes) by setting the wght variation axis.
func (*TextStyles) StrikethroughInRange ¶
func (s *TextStyles) StrikethroughInRange(startInBytes, endInBytes int, fallback bool) (strikethrough, uniform bool)
StrikethroughInRange returns the strikethrough state every byte of [startInBytes, endInBytes) takes and whether the state is uniform. A byte with a strikethrough override takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
func (*TextStyles) UnderlineInRange ¶
func (s *TextStyles) UnderlineInRange(startInBytes, endInBytes int, fallback bool) (underline, uniform bool)
UnderlineInRange returns the underline state every byte of [startInBytes, endInBytes) takes and whether the state is uniform. A byte with an underline override takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
func (*TextStyles) UnsetBackgroundColorInRange ¶
func (s *TextStyles) UnsetBackgroundColorInRange(startInBytes, endInBytes int)
UnsetBackgroundColorInRange removes the background color override in [startInBytes, endInBytes).
func (*TextStyles) UnsetColorInRange ¶
func (s *TextStyles) UnsetColorInRange(startInBytes, endInBytes int)
UnsetColorInRange removes the text color override in [startInBytes, endInBytes).
func (*TextStyles) UnsetFeatureInRange ¶
func (s *TextStyles) UnsetFeatureInRange(startInBytes, endInBytes int, tag text.Tag)
UnsetFeatureInRange removes the override of the OpenType feature tag in [startInBytes, endInBytes).
func (*TextStyles) UnsetFontFamilyInRange ¶
func (s *TextStyles) UnsetFontFamilyInRange(startInBytes, endInBytes int)
UnsetFontFamilyInRange removes the font family override in [startInBytes, endInBytes).
func (*TextStyles) UnsetItalicInRange ¶
func (s *TextStyles) UnsetItalicInRange(startInBytes, endInBytes int)
UnsetItalicInRange removes the italic override in [startInBytes, endInBytes).
func (*TextStyles) UnsetLangInRange ¶
func (s *TextStyles) UnsetLangInRange(startInBytes, endInBytes int)
UnsetLangInRange removes the language override in [startInBytes, endInBytes).
func (*TextStyles) UnsetScaleInRange ¶
func (s *TextStyles) UnsetScaleInRange(startInBytes, endInBytes int)
UnsetScaleInRange removes the font size multiplier override in [startInBytes, endInBytes).
func (*TextStyles) UnsetStrikethroughInRange ¶
func (s *TextStyles) UnsetStrikethroughInRange(startInBytes, endInBytes int)
UnsetStrikethroughInRange removes the strikethrough override in [startInBytes, endInBytes).
func (*TextStyles) UnsetUnderlineInRange ¶
func (s *TextStyles) UnsetUnderlineInRange(startInBytes, endInBytes int)
UnsetUnderlineInRange removes the underline override in [startInBytes, endInBytes).
func (*TextStyles) UnsetVariationInRange ¶
func (s *TextStyles) UnsetVariationInRange(startInBytes, endInBytes int, tag text.Tag)
UnsetVariationInRange removes the override of the OpenType variation axis tag in [startInBytes, endInBytes).
func (*TextStyles) UnsetWeightInRange ¶
func (s *TextStyles) UnsetWeightInRange(startInBytes, endInBytes int)
UnsetWeightInRange removes the font weight override in [startInBytes, endInBytes).
func (*TextStyles) VariationInRange ¶
func (s *TextStyles) VariationInRange(startInBytes, endInBytes int, tag text.Tag, fallback float32) (value float32, uniform bool)
VariationInRange returns the value of the OpenType variation axis tag every byte of [startInBytes, endInBytes) takes and whether the value is uniform. A byte with an override of the axis takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
func (*TextStyles) WeightInRange ¶
func (s *TextStyles) WeightInRange(startInBytes, endInBytes int, fallback text.Weight) (weight text.Weight, uniform bool)
WeightInRange returns the font weight every byte of [startInBytes, endInBytes) takes and whether the weight is uniform. A byte with a wght variation override takes the override's value; every other byte takes fallback. An empty range is uniform with fallback.
type Toggle ¶
type Toggle struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
func (*Toggle) CursorShape ¶
func (t *Toggle) CursorShape(context *guigui.Context, widgetBounds *guigui.WidgetBounds) (ebiten.CursorShapeType, bool)
func (*Toggle) HandlePointingInput ¶
func (t *Toggle) HandlePointingInput(context *guigui.Context, widgetBounds *guigui.WidgetBounds) guigui.HandleInputResult
func (*Toggle) OnValueChanged ¶
func (*Toggle) WriteStateKey ¶
func (t *Toggle) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type TooltipArea ¶
type TooltipArea struct {
guigui.DefaultWidget
// contains filtered or unexported fields
}
TooltipArea is a standalone widget that shows a balloon popup when the mouse cursor hovers over the area specified by its bounds, or over the areas set by TooltipArea.SetHitAreas. The tooltip appears above the hovered area and has a black background regardless of the color mode. The tooltip automatically disappears when the mouse cursor moves out of the area.
TooltipArea shows a modeless popup: it does not prevent user interactions with other widgets.
func (*TooltipArea) Build ¶
func (t *TooltipArea) Build(context *guigui.Context, adder *guigui.ChildAdder) error
Build implements guigui.Widget.Build.
func (*TooltipArea) Layout ¶
func (t *TooltipArea) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)
Layout implements guigui.Widget.Layout.
func (*TooltipArea) Measure ¶
func (t *TooltipArea) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point
Measure implements guigui.Widget.Measure.
func (*TooltipArea) SetContent ¶
func (t *TooltipArea) SetContent(widget guigui.Widget)
SetContent sets a custom content widget for the tooltip balloon. TooltipArea.SetContent and TooltipArea.SetText are exclusive; TooltipArea.SetContent takes priority.
func (*TooltipArea) SetHitAreas ¶
func (t *TooltipArea) SetHitAreas(areas []image.Rectangle)
SetHitAreas sets the areas, in screen coordinates, where hovering triggers the tooltip. The areas take effect only within the widget's bounds. A nil slice means the whole bounds; a non-nil empty slice means no area triggers the tooltip.
func (*TooltipArea) SetText ¶
func (t *TooltipArea) SetText(text string)
SetText sets the tooltip balloon text. TooltipArea.SetContent and TooltipArea.SetText are exclusive; TooltipArea.SetContent takes priority.
func (*TooltipArea) Tick ¶
func (t *TooltipArea) Tick(context *guigui.Context, widgetBounds *guigui.WidgetBounds) error
Tick implements guigui.Widget.Tick.
func (*TooltipArea) WriteStateKey ¶
func (t *TooltipArea) WriteStateKey(context *guigui.Context, w *guigui.StateKeyWriter)
type UnicodeRange ¶
UnicodeRange is an inclusive range of code points.
type VerticalAlign ¶
type VerticalAlign int
const ( VerticalAlignTop VerticalAlign = VerticalAlign(textutil.VerticalAlignTop) VerticalAlignMiddle VerticalAlign = VerticalAlign(textutil.VerticalAlignMiddle) VerticalAlignBottom VerticalAlign = VerticalAlign(textutil.VerticalAlignBottom) )
type WrapMode ¶
type WrapMode int
WrapMode selects how visual lines wrap when text exceeds the available width.
const ( // WrapModeNone disables automatic wrapping; content extends past the // available width and only the explicit hard line breaks in the source // text introduce new visual lines. WrapModeNone WrapMode = WrapMode(textutil.WrapModeNone) // WrapModeNormal wraps at Unicode line break opportunities. These // coincide with word boundaries in most cases, but not always. WrapModeNormal WrapMode = WrapMode(textutil.WrapModeNormal) // WrapModeAnywhere wraps at any grapheme cluster boundary, breaking // inside words when needed to fit the available width. WrapModeAnywhere WrapMode = WrapMode(textutil.WrapModeAnywhere) )
Source Files
¶
- abstractlist.go
- abstractnumberinput.go
- background.go
- button.go
- checkbox.go
- color.go
- combobox.go
- contextmenuarea.go
- divider.go
- drawer.go
- expander.go
- font.go
- form.go
- image.go
- list.go
- menubar.go
- numberinput.go
- panel.go
- popup.go
- popupmenu.go
- progressbar.go
- radiobutton.go
- resourceimage.go
- roundedcornerwidget.go
- scroll.go
- segmentedcontrol.go
- select.go
- size.go
- slider.go
- statekey.go
- table.go
- text.go
- textinput.go
- textstyle.go
- textstyles.go
- toggle.go
- tooltiparea.go
- util.go
- virtualscrollpanel.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
chunk
Package chunk places cache-friendly boundaries within a single logical line of text.
|
Package chunk places cache-friendly boundaries within a single logical line of text. |
|
piecetable
Package piecetable provides an editable text buffer with undo/redo support.
|
Package piecetable provides an editable text buffer with undo/redo support. |
|
textstyle
Package textstyle provides the attributed-run model for ranged text styling: a set of style overrides laid over byte ranges of a single text value.
|
Package textstyle provides the attributed-run model for ranged text styling: a set of style overrides laid over byte ranges of a single text value. |
|
textwidget
Package textwidget provides the theme-free core of the basicwidget text widgets: the editable Text widget and the input helpers it is built on.
|
Package textwidget provides the theme-free core of the basicwidget text widgets: the editable Text widget and the input helpers it is built on. |