Documentation ¶
Index ¶
- Constants
- Variables
- func Dumb(win *Window, w Widget) layout.Widget
- func EaseBezier(t float64) float64
- func FairlySimpleTable(win *Window, gtx layout.Context, tbl *Table, scroll *YScrollableListState, ...) layout.Dimensions
- func Fill(win *Window, ops *op.Ops, c color.Oklch)
- func FillShape(win *Window, ops *op.Ops, c color.Oklch, shape clip.Op)
- func FromListPosition(lp layout.Position, elements int, majorAxisSize int) (start, end float32)
- func Lerp[T constraints.Integer | constraints.Float](start, end T, r float64) T
- func SimpleTable(win *Window, gtx layout.Context, tbl *Table, scroll *YScrollableListState, ...) layout.Dimensions
- func StartSimpleAnimation[T constraints.Integer | constraints.Float](gtx layout.Context, anim *Animation[T], v1, v2 T, d time.Duration, ...)
- type Action
- type AnchorStrategy
- type Animation
- type Background
- type Border
- type Bordered
- type BorderedTextStyle
- type ButtonStyle
- type CellFn
- type CheckBoxGroupStyle
- type CheckBoxStyle
- type Column
- type Command
- type CommandPalette
- type CommandProvider
- type CommandSlice
- type Component
- type ComponentButtons
- type ComponentState
- type DialogStyle
- type EasingFunction
- type EditorStyle
- type ExecuteAction
- type FauxTableRowStyle
- type Filter
- type FlameGraphState
- type FlameGraphStyle
- type FoldableStyle
- type Future
- type Futures
- type GridStyle
- type HistogramState
- type HistogramStyle
- type LabelStyle
- type LerpFunction
- type Lerper
- type ListStyle
- type ListWindow
- type ListWindowItem
- type Menu
- type MenuDividerStyle
- type MenuGroup
- type MenuGroupStyle
- type MenuItem
- type MenuItemStyle
- type MenuStyle
- type ModalStyle
- type MultiCommandProvider
- type NormalCommand
- type Palette
- type ProgressBarStyle
- type Recording
- type RememberingList
- type ResizeStyle
- type RowFn
- type ScrollIndicatorStyle
- type ScrollTrackStyle
- type ScrollbarStyle
- type Shortcut
- type SortOrder
- type SwitchStyle
- type TabClick
- type TabbedState
- type TabbedStyle
- type Table
- func (tbl *Table) ClickedColumn() (int, bool)
- func (tbl *Table) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
- func (tbl *Table) SetColumns(win *Window, gtx layout.Context, cols []Column)
- func (tbl *Table) SortByClickedColumn() (int, bool)
- func (tbl *Table) Update(gtx layout.Context)
- type TableExpandedRowStyle
- type TableHeaderRowStyle
- type TableRowStyle
- type TableSimpleRowStyle
- type TextBoxStyle
- type Theme
- type TooltipStyle
- type Unit
- type Widget
- type WidgetComponent
- type Window
- func (win *Window) Actions() []Action
- func (win *Window) AddCommandProvider(cp CommandProvider)
- func (win *Window) AddShortcut(s Shortcut)
- func (win *Window) CloseModal()
- func (win *Window) ColorMaterial(gtx layout.Context, c color.Oklch) op.CallOp
- func (win *Window) CommandProviders() []CommandProvider
- func (win *Window) ConvertColor(c color.Oklch) stdcolor.NRGBA
- func (win *Window) EmitAction(l Action)
- func (win *Window) Layout(ops *op.Ops, ev system.FrameEvent, ...)
- func (win *Window) PressedShortcuts() []Shortcut
- func (win *Window) SetContextMenu(items []*MenuItem)
- func (win *Window) SetModal(w Widget)
- func (win *Window) SetPopup(w Widget)
- func (win *Window) SetTooltip(w Widget)
- func (win *Window) ShowNotification(gtx layout.Context, msg string)
- func (win *Window) TextDimensions(gtx layout.Context, l widget.Label, font font.Font, size unit.Sp, s string) layout.Dimensions
- func (win *Window) TextLength(gtx layout.Context, l widget.Label, font font.Font, size unit.Sp, s string) int
- func (win *Window) Update(ops *op.Ops, ev system.FrameEvent, w func(win *Window, gtx layout.Context))
- type YScrollableListState
- type YScrollableListStyle
Constants ¶
const ( DefaultDividerWidth unit.Dp = 1 DefaultDividerMargin unit.Dp = 1 DefaultDividerHandleMinVerticalMargin unit.Dp = 2 DefaultDividerHandleMaxHeight unit.Dp = 12 DefaultDividerHandleWidth unit.Dp = 3 DefaultDividerHandleRadius unit.Dp = 2 DefaultHeaderPadding unit.Dp = 5 DefaultHeaderBorder unit.Dp = 1 DefaultExpandedBorder unit.Dp = 1 )
Variables ¶
var DefaultPalette = Palette{ Background: oklch(99.44, 0.027, 106.89), Foreground: oklch(0, 0, 0), ForegroundDisabled: oklch(55.21, 0, 0), NavigationLink: oklch(57.32, 0.235, 29.23), OpenLink: oklch(45.2, 0.31, 264.05), Link: oklch(45.2, 0.31, 264.05), PrimarySelection: oklcha(93.11, 0.101, 108.21, 0.6), Border: oklch(0, 0, 0), Popup: struct { TitleForeground color.Oklch TitleBackground color.Oklch Background color.Oklch }{ TitleForeground: oklch(0, 0, 0), TitleBackground: oklch(98.82, 0.017, 196.89), Background: oklch(98.29, 0.029, 145.35), }, Menu: struct { Background color.Oklch Selected color.Oklch Border color.Oklch Disabled color.Oklch }{ Background: oklch(98.82, 0.017, 196.89), Selected: oklch(89.92, 0.081, 195.81), Border: oklch(89.92, 0.081, 195.81), Disabled: oklch(73.8, 0, 0), }, Table: struct { EvenRowBackground color.Oklch OddRowBackground color.Oklch HoveredRowBackground color.Oklch HeaderBackground color.Oklch Divider color.Oklch DragHandle color.Oklch ExpandedBorder color.Oklch ExpandedBackground color.Oklch }{ EvenRowBackground: oklch(99.44, 0.027, 106.89), OddRowBackground: oklch(99.44, 0.027, 106.89), HoveredRowBackground: oklch(95.63, 0.024, 106.84), HeaderBackground: oklch(96.48, 0.026, 106.88), Divider: oklch(80.15, 0, 0), DragHandle: oklch(0, 0, 0), ExpandedBorder: oklch(80.15, 0, 0), ExpandedBackground: oklch(88.63, 0.053, 346), }, }
Functions ¶
func EaseBezier ¶ added in v0.4.0
func FairlySimpleTable ¶ added in v0.4.0
func FairlySimpleTable( win *Window, gtx layout.Context, tbl *Table, scroll *YScrollableListState, nrows int, rowFn RowFn, ) layout.Dimensions
func Fill ¶ added in v0.4.0
Fill paints an infinitely large plane with the provided color. It is intended to be used with a clip.Op already in place to limit the painted area. Use FillShape unless you need to paint several times within the same clip.Op.
func FromListPosition ¶ added in v0.4.0
FromListPosition converts a layout.Position into two floats representing the location of the viewport on the underlying content. It needs to know the number of elements in the list and the major-axis size of the list in order to do this. The returned values will be in the range [0,1], and start will be less than or equal to end.
func Lerp ¶ added in v0.4.0
func Lerp[T constraints.Integer | constraints.Float](start, end T, r float64) T
func SimpleTable ¶ added in v0.4.0
func SimpleTable( win *Window, gtx layout.Context, tbl *Table, scroll *YScrollableListState, nrows int, cellFn CellFn, ) layout.Dimensions
func StartSimpleAnimation ¶ added in v0.4.0
func StartSimpleAnimation[T constraints.Integer | constraints.Float](gtx layout.Context, anim *Animation[T], v1, v2 T, d time.Duration, ease EasingFunction)
Types ¶
type AnchorStrategy ¶
type AnchorStrategy uint8
AnchorStrategy defines a means of attaching a scrollbar to content.
const ( // Occupy reserves space for the scrollbar, making the underlying // content region smaller on one axis. Occupy AnchorStrategy = iota // Overlay causes the scrollbar to float atop the content without // occupying any space. Content in the underlying area can be occluded // by the scrollbar. Overlay )
type Animation ¶ added in v0.4.0
type Animation[T any] struct { StartValue T EndValue T StartTime time.Time Duration time.Duration Ease EasingFunction Lerp LerpFunction[T] // contains filtered or unexported fields }
type Background ¶ added in v0.4.0
func (Background) Layout ¶ added in v0.4.0
func (b Background) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
type BorderedTextStyle ¶
type BorderedTextStyle struct { Text string Padding unit.Dp BorderSize unit.Dp BorderColor color.Oklch TextSize unit.Sp TextColor color.Oklch BackgroundColor color.Oklch }
func BorderedText ¶
func BorderedText(th *Theme, s string) BorderedTextStyle
func (BorderedTextStyle) Layout ¶
func (bt BorderedTextStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type ButtonStyle ¶
type ButtonStyle struct { Text string Button *widget.Clickable ActiveBackgroundColor color.Oklch BackgroundColor color.Oklch BorderColor color.Oklch TextColor color.Oklch TextColorDisabled color.Oklch }
func (ButtonStyle) Layout ¶
func (b ButtonStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type CheckBoxGroupStyle ¶ added in v0.2.0
type CheckBoxGroupStyle struct { Clickable *widget.Clickable Label string TextSize unit.Sp ForegroundColor color.Oklch BackgroundColor color.Oklch TextColor color.Oklch }
func CheckBoxGroup ¶ added in v0.2.0
func CheckBoxGroup(th *Theme, clickable *widget.Clickable, label string) CheckBoxGroupStyle
func (CheckBoxGroupStyle) Layout ¶ added in v0.2.0
func (chkgrp CheckBoxGroupStyle) Layout(win *Window, gtx layout.Context, checkboxes ...CheckBoxStyle) layout.Dimensions
type CheckBoxStyle ¶
type CheckBoxStyle struct { Checkbox widget.Boolean Label string TextSize unit.Sp ForegroundColor color.Oklch BackgroundColor color.Oklch TextColor color.Oklch }
func (CheckBoxStyle) Layout ¶
func (c CheckBoxStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type CommandPalette ¶ added in v0.4.0
type CommandPalette struct { Prompt string // contains filtered or unexported fields }
XXX split into style and state
func (*CommandPalette) Layout ¶ added in v0.4.0
func (pl *CommandPalette) Layout(win *Window, gtx layout.Context) layout.Dimensions
func (*CommandPalette) Set ¶ added in v0.4.0
func (pl *CommandPalette) Set(cmds CommandProvider)
type CommandProvider ¶ added in v0.4.0
type CommandSlice ¶ added in v0.4.0
type CommandSlice []Command
func (CommandSlice) At ¶ added in v0.4.0
func (cs CommandSlice) At(idx int) Command
func (CommandSlice) Len ¶ added in v0.4.0
func (cs CommandSlice) Len() int
type Component ¶ added in v0.4.0
type Component interface { Layout(win *Window, gtx layout.Context) layout.Dimensions // Title is the title to display as the window or tab title. Title() string // WantsTransition indicates that the component wants to transition to a different state. It is not // guaranteed that the request will be honored. Calling WantsTransition clears the desired state // transition. // // This method is not thread-safe. WantsTransition(gtx layout.Context) ComponentState // Transition notifies the component of its new state. This is called at least once before drawing the // component for the first time. There may or may not be a transition to the closed state. Transition(state ComponentState) }
A Component is a widget that can be displayed as a panel, tab, or in its own window.
type ComponentButtons ¶ added in v0.4.0
type ComponentButtons struct {
// contains filtered or unexported fields
}
func (*ComponentButtons) Backed ¶ added in v0.4.0
func (pb *ComponentButtons) Backed(gtx layout.Context) bool
func (*ComponentButtons) Layout ¶ added in v0.4.0
func (pb *ComponentButtons) Layout(win *Window, gtx layout.Context) layout.Dimensions
func (*ComponentButtons) Transition ¶ added in v0.4.0
func (pb *ComponentButtons) Transition(state ComponentState)
func (*ComponentButtons) WantsTransition ¶ added in v0.4.0
func (pb *ComponentButtons) WantsTransition(gtx layout.Context) ComponentState
type ComponentState ¶ added in v0.4.0
type ComponentState int
ComponentState describes a component's current state or desired state.
const ( ComponentStateNone ComponentState = iota ComponentStatePanel ComponentStateTab ComponentStateWindow ComponentStateClosed )
func (ComponentState) String ¶ added in v0.4.0
func (state ComponentState) String() string
type DialogStyle ¶
type DialogStyle struct { BorderWidth unit.Dp BorderColor color.Oklch Title string TitleSize unit.Sp TitleColor color.Oklch TitleBackground color.Oklch TitlePadding unit.Dp Background color.Oklch Padding unit.Dp }
func Dialog ¶
func Dialog(th *Theme, title string) DialogStyle
func (DialogStyle) Layout ¶
func (ds DialogStyle) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
type EasingFunction ¶ added in v0.4.0
func EaseIn ¶ added in v0.4.0
func EaseIn(power int) EasingFunction
func EaseOut ¶ added in v0.4.0
func EaseOut(power int) EasingFunction
type EditorStyle ¶
type EditorStyle struct { Font font.Font TextSize unit.Sp // Color is the text color. Color color.Oklch // Hint contains the text displayed when the editor is empty. Hint string // HintColor is the color of hint text. HintColor color.Oklch // SelectionColor is the color of the background for selected text. SelectionColor color.Oklch Editor *widget.Editor // contains filtered or unexported fields }
func (EditorStyle) Layout ¶
func (e EditorStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type ExecuteAction ¶ added in v0.4.0
func (ExecuteAction) IsAction ¶ added in v0.4.0
func (ExecuteAction) IsAction()
type FauxTableRowStyle ¶ added in v0.4.0
func FauxTableRow ¶ added in v0.4.0
func FauxTableRow(tbl *Table, bg color.Oklch) FauxTableRowStyle
func (FauxTableRowStyle) Layout ¶ added in v0.4.0
func (row FauxTableRowStyle) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
type Filter ¶
type Filter interface {
Filter(item ListWindowItem) bool
}
type FlameGraphState ¶ added in v0.4.0
type FlameGraphState struct {
// contains filtered or unexported fields
}
type FlameGraphStyle ¶ added in v0.4.0
type FlameGraphStyle struct { State *widget.FlameGraph StyleState *FlameGraphState Color func(level, idx int, f *widget.FlamegraphFrame, hovered bool) color.Oklch }
func FlameGraph ¶ added in v0.4.0
func FlameGraph(state *widget.FlameGraph, sstate *FlameGraphState) FlameGraphStyle
func (FlameGraphStyle) Layout ¶ added in v0.4.0
func (fg FlameGraphStyle) Layout(win *Window, gtx layout.Context) (dims layout.Dimensions)
type FoldableStyle ¶
type FoldableStyle struct { Title string Closed *widget.Bool TextSize unit.Sp TextColor color.Oklch }
func (FoldableStyle) Layout ¶
func (f FoldableStyle) Layout(win *Window, gtx layout.Context, contents Widget) layout.Dimensions
type Future ¶ added in v0.3.0
type Future[T any] struct { // contains filtered or unexported fields }
func (*Future[T]) MustResult ¶ added in v0.3.0
func (ft *Future[T]) MustResult() T
func (*Future[T]) ResultNoWait ¶ added in v0.3.0
type GridStyle ¶
type GridStyle struct { State *component.GridState VScrollbarStyle ScrollbarStyle HScrollbarStyle ScrollbarStyle }
type HistogramState ¶ added in v0.3.0
type HistogramState struct { Histogram *widget.Histogram // contains filtered or unexported fields }
func (*HistogramState) Update ¶ added in v0.4.0
func (hs *HistogramState) Update(gtx layout.Context) (start, end widget.FloatDuration, ok bool)
type HistogramStyle ¶ added in v0.3.0
type HistogramStyle struct { State *HistogramState XLabel, YLabel string TextColor color.Oklch TextSize unit.Sp LineColor color.Oklch BinColor color.Oklch HoveredBinColor color.Oklch SelectedBinColor color.Oklch OverflowBinColor color.Oklch }
func Histogram ¶ added in v0.3.0
func Histogram(th *Theme, state *HistogramState) HistogramStyle
func (HistogramStyle) Layout ¶ added in v0.3.0
func (hs HistogramStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type LabelStyle ¶ added in v0.4.0
type LabelStyle struct { Font font.Font Color color.Oklch Alignment text.Alignment MaxLines int TextSize unit.Sp Text string }
func Label ¶ added in v0.4.0
func Label(th *Theme, txt string) LabelStyle
func LineLabel ¶ added in v0.4.0
func LineLabel(th *Theme, txt string) LabelStyle
func (LabelStyle) Dimensions ¶ added in v0.4.0
func (ls LabelStyle) Dimensions(win *Window, gtx layout.Context) layout.Dimensions
func (LabelStyle) Layout ¶ added in v0.4.0
func (ls LabelStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type LerpFunction ¶ added in v0.4.0
type ListStyle ¶
type ListStyle struct { Main ScrollbarStyle Cross ScrollbarStyle AnchorStrategy EnableCrossScrolling bool // contains filtered or unexported fields }
ListStyle configures the presentation of a layout.List with a scrollbar.
type ListWindow ¶
type ListWindow struct { BuildFilter func(string) Filter // contains filtered or unexported fields }
func NewListWindow ¶
func NewListWindow(th *Theme) *ListWindow
func (*ListWindow) Cancelled ¶
func (w *ListWindow) Cancelled() bool
func (*ListWindow) Confirmed ¶
func (w *ListWindow) Confirmed() (any, bool)
func (*ListWindow) Layout ¶
func (w *ListWindow) Layout(win *Window, gtx layout.Context) layout.Dimensions
func (*ListWindow) SetItems ¶
func (w *ListWindow) SetItems(items []ListWindowItem)
type ListWindowItem ¶
type MenuDividerStyle ¶
func MenuDivider ¶
func MenuDivider(th *Theme) MenuDividerStyle
func (MenuDividerStyle) Layout ¶
func (mds MenuDividerStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type MenuGroupStyle ¶
func NewMenuGroupStyle ¶
func NewMenuGroupStyle(th *Theme, group *MenuGroup) MenuGroupStyle
func (MenuGroupStyle) Layout ¶
func (g MenuGroupStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type MenuItem ¶
type MenuItemStyle ¶
type MenuItemStyle struct { Item *MenuItem Foreground color.Oklch Background color.Oklch Selected color.Oklch Disabled color.Oklch }
func NewMenuItemStyle ¶
func NewMenuItemStyle(th *Theme, item *MenuItem) MenuItemStyle
func (MenuItemStyle) Layout ¶
func (item MenuItemStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type MenuStyle ¶
type MenuStyle struct { Menu *Menu Foreground color.Oklch Background color.Oklch Selected color.Oklch Border color.Oklch Disabled color.Oklch }
func NewMenuStyle ¶
type ModalStyle ¶
func Modal ¶
func Modal(cancelled *bool) ModalStyle
func (ModalStyle) Layout ¶
func (m ModalStyle) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
type MultiCommandProvider ¶ added in v0.4.0
type MultiCommandProvider struct {
Providers []CommandProvider
}
func (MultiCommandProvider) At ¶ added in v0.4.0
func (mcp MultiCommandProvider) At(idx int) Command
func (MultiCommandProvider) Len ¶ added in v0.4.0
func (mcp MultiCommandProvider) Len() int
type NormalCommand ¶ added in v0.4.0
type NormalCommand struct { PrimaryLabel string SecondaryLabel string Category string Color color.Oklch Shortcut string Aliases []string Fn func() Action }
func (NormalCommand) Filter ¶ added in v0.4.0
func (cmd NormalCommand) Filter(input string) bool
func (NormalCommand) Layout ¶ added in v0.4.0
func (cmd NormalCommand) Layout(win *Window, gtx layout.Context, current bool) layout.Dimensions
func (NormalCommand) Link ¶ added in v0.4.0
func (cmd NormalCommand) Link() Action
type Palette ¶
type Palette struct { Background color.Oklch Foreground color.Oklch ForegroundDisabled color.Oklch OpenLink color.Oklch Link color.Oklch PrimarySelection color.Oklch Border color.Oklch Popup struct { TitleForeground color.Oklch TitleBackground color.Oklch Background color.Oklch } Menu struct { Background color.Oklch Selected color.Oklch Border color.Oklch Disabled color.Oklch } Table struct { EvenRowBackground color.Oklch OddRowBackground color.Oklch HoveredRowBackground color.Oklch HeaderBackground color.Oklch Divider color.Oklch DragHandle color.Oklch ExpandedBorder color.Oklch ExpandedBackground color.Oklch } }
type ProgressBarStyle ¶
type ProgressBarStyle struct { ForegroundColor color.Oklch BackgroundColor color.Oklch BorderWidth unit.Dp Progress float32 }
func ProgressBar ¶
func ProgressBar(th *Theme, progress float32) ProgressBarStyle
func (ProgressBarStyle) Layout ¶
func (p ProgressBarStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type Recording ¶ added in v0.4.0
type Recording struct { Call op.CallOp Dimensions layout.Dimensions }
type RememberingList ¶ added in v0.4.0
type RememberingList struct {
// contains filtered or unexported fields
}
func (*RememberingList) Layout ¶ added in v0.4.0
func (rlist *RememberingList) Layout(gtx layout.Context, len int, w layout.ListElement) layout.Dimensions
type ResizeStyle ¶
func (ResizeStyle) Layout ¶
func (rs ResizeStyle) Layout(win *Window, gtx layout.Context, w1, w2 Widget) layout.Dimensions
type ScrollIndicatorStyle ¶
type ScrollIndicatorStyle struct { // MajorMinLen is the smallest that the scroll indicator is allowed to // be along the major axis. MajorMinLen unit.Dp // MinorWidth is the width of the scroll indicator across the minor axis. MinorWidth unit.Dp // Color and HoverColor are the normal and hovered colors of the scroll // indicator. Color, HoverColor color.Oklch }
ScrollIndicatorStyle configures the presentation of a scroll indicator.
type ScrollTrackStyle ¶
type ScrollTrackStyle struct { // MajorPadding and MinorPadding along the major and minor axis of the // scrollbar's track. This is used to keep the scrollbar from touching // the edges of the content area. MinorPadding unit.Dp // Color of the track background. Color color.Oklch }
ScrollTrackStyle configures the presentation of a track for a scroll area.
type ScrollbarStyle ¶
type ScrollbarStyle struct { Scrollbar *widget.Scrollbar Track ScrollTrackStyle Indicator ScrollIndicatorStyle }
ScrollbarStyle configures the presentation of a scrollbar.
func Scrollbar ¶
func Scrollbar(th *Theme, state *widget.Scrollbar) ScrollbarStyle
Scrollbar configures the presentation of a scrollbar using the provided theme and state.
func (ScrollbarStyle) Layout ¶
func (s ScrollbarStyle) Layout(win *Window, gtx layout.Context, axis layout.Axis, viewportStart, viewportEnd float32) layout.Dimensions
Layout the scrollbar.
func (ScrollbarStyle) Width ¶
func (s ScrollbarStyle) Width() unit.Dp
Width returns the minor axis width of the scrollbar in its current configuration (taking padding for the scroll track into account).
type SwitchStyle ¶ added in v0.3.0
func (SwitchStyle) Layout ¶ added in v0.3.0
func (ss SwitchStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type TabbedState ¶ added in v0.3.0
type TabbedState struct { Current int // contains filtered or unexported fields }
type TabbedStyle ¶ added in v0.3.0
type TabbedStyle struct { State *TabbedState Tabs []string }
func Tabbed ¶ added in v0.3.0
func Tabbed(state *TabbedState, tabs []string) TabbedStyle
func (TabbedStyle) Layout ¶ added in v0.3.0
func (ts TabbedStyle) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
type Table ¶ added in v0.4.0
type Table struct { Columns []Column SortOrder SortOrder SortedBy int // contains filtered or unexported fields }
TODO(dh): this should be in package widget
func (*Table) ClickedColumn ¶ added in v0.4.0
func (*Table) SetColumns ¶ added in v0.4.0
func (*Table) SortByClickedColumn ¶ added in v0.4.0
type TableExpandedRowStyle ¶ added in v0.4.0
type TableExpandedRowStyle struct {
Table *Table
}
func TableExpandedRow ¶ added in v0.4.0
func TableExpandedRow(tbl *Table) TableExpandedRowStyle
func (TableExpandedRowStyle) Layout ¶ added in v0.4.0
func (ex TableExpandedRowStyle) Layout(win *Window, gtx layout.Context, w Widget) layout.Dimensions
type TableHeaderRowStyle ¶ added in v0.4.0
type TableHeaderRowStyle struct {
Table *Table
}
func TableHeaderRow ¶ added in v0.4.0
func TableHeaderRow(tbl *Table) TableHeaderRowStyle
func (TableHeaderRowStyle) Layout ¶ added in v0.4.0
func (row TableHeaderRowStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type TableRowStyle ¶ added in v0.4.0
func TableRow ¶ added in v0.4.0
func TableRow(tbl *Table, hdr bool) TableRowStyle
func (TableRowStyle) Layout ¶ added in v0.4.0
func (row TableRowStyle) Layout(win *Window, gtx layout.Context, w RowFn) layout.Dimensions
type TableSimpleRowStyle ¶ added in v0.4.0
type TableSimpleRowStyle struct {
Table *Table
}
func TableSimpleRow ¶ added in v0.4.0
func TableSimpleRow(tbl *Table) TableSimpleRowStyle
func (TableSimpleRowStyle) Layout ¶ added in v0.4.0
func (row TableSimpleRowStyle) Layout( win *Window, gtx layout.Context, rowIdx int, cellFn CellFn, ) layout.Dimensions
type TextBoxStyle ¶ added in v0.3.0
type TextBoxStyle struct { EditorStyle Validate func(s string) bool }
func TextBox ¶ added in v0.3.0
func TextBox(th *Theme, editor *widget.Editor, hint string) TextBoxStyle
func (TextBoxStyle) Layout ¶ added in v0.3.0
func (tb TextBoxStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type Theme ¶
type TooltipStyle ¶
type TooltipStyle struct { Message string Padding unit.Dp BorderSize unit.Dp BorderColor color.Oklch TextSize unit.Sp TextColor color.Oklch BackgroundColor color.Oklch }
func Tooltip ¶
func Tooltip(th *Theme, msg string) TooltipStyle
func (TooltipStyle) Layout ¶
func (tt TooltipStyle) Layout(win *Window, gtx layout.Context) layout.Dimensions
type WidgetComponent ¶ added in v0.4.0
type WidgetComponent struct { ComponentButtons // contains filtered or unexported fields }
WidgetComponent turns any widget into a Component. You are responsible for handling component button events.
func (*WidgetComponent) Layout ¶ added in v0.4.0
func (wp *WidgetComponent) Layout(win *Window, gtx layout.Context) layout.Dimensions
type Window ¶
type Window struct { AppWindow *app.Window Futures *Futures Theme *Theme Menu *Menu // The current frame number Frame uint64 // contains filtered or unexported fields }
func (*Window) AddCommandProvider ¶ added in v0.4.0
func (win *Window) AddCommandProvider(cp CommandProvider)
func (*Window) AddShortcut ¶ added in v0.3.0
AddShortcut adds a new shortcut. The shortcut will only remain registered until the next call to Render.
func (*Window) CloseModal ¶
func (win *Window) CloseModal()
func (*Window) ColorMaterial ¶ added in v0.4.0
func (*Window) CommandProviders ¶ added in v0.4.0
func (win *Window) CommandProviders() []CommandProvider
func (*Window) ConvertColor ¶ added in v0.3.0
func (*Window) EmitAction ¶ added in v0.4.0
func (*Window) Layout ¶ added in v0.4.0
func (win *Window) Layout(ops *op.Ops, ev system.FrameEvent, w func(win *Window, gtx layout.Context) layout.Dimensions)
func (*Window) PressedShortcuts ¶ added in v0.3.0
PressedShortcuts returns the shortcuts that have been pressed since the last call to Render. The slice is only valid until the next call to Render.
func (*Window) SetContextMenu ¶
func (*Window) SetPopup ¶
TODO(dh): support specifying the minimum/maximum size of the modal, but make it optional
func (*Window) SetTooltip ¶
func (*Window) ShowNotification ¶
func (*Window) TextDimensions ¶ added in v0.3.0
func (*Window) TextLength ¶ added in v0.3.0
type YScrollableListState ¶ added in v0.4.0
type YScrollableListState struct {
// contains filtered or unexported fields
}
type YScrollableListStyle ¶ added in v0.4.0
type YScrollableListStyle struct {
// contains filtered or unexported fields
}
func YScrollableList ¶ added in v0.4.0
func YScrollableList(state *YScrollableListState) YScrollableListStyle
func (YScrollableListStyle) Layout ¶ added in v0.4.0
func (tbl YScrollableListStyle) Layout( win *Window, gtx layout.Context, body func(win *Window, gtx layout.Context, list *RememberingList) layout.Dimensions, ) layout.Dimensions