Documentation ¶
Index ¶
- func LoadIcon(data []byte) widget.Icon
- func LoadIcons(data ...[]byte) []widget.Icon
- type Anim
- type ClickElement
- type ClickIcon
- type ClickList
- type ClickListWrap
- type Draggable
- type Error
- type File
- type FilePalettes
- type FileSelection
- type Hover
- type Icons
- func (s *Icons) Click(idx int)
- func (s *Icons) Hidden(idx int) bool
- func (s *Icons) Hide(indexes ...int)
- func (s *Icons) Hovered(idx int) bool
- func (s *Icons) Layout(gtx layout.Context, onClick, onPress func(gtx layout.Context, idx int)) layout.Dimensions
- func (s *Icons) SetStatus(idx int, status bool)
- func (s *Icons) Show(indexes ...int)
- func (s *Icons) Status(idx int) bool
- type Input
- type Label
- type ListCue
- type MenuPopup
- type Modal
- type Resizable
- type Select
- type Tabs
- type Tree
- type TreeElement
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Anim ¶
type Anim struct { // Next is the interpolator function. Next func(float32) (float32, time.Duration) // contains filtered or unexported fields }
Anim manages Frame refreshes based on an interpolator function.
func (*Anim) Animate ¶
Animate moves the animation forward if possible and returns whether or not the animation is complete.
type ClickElement ¶
ClickElement displays the ith element.
type ClickIcon ¶
type ClickIcon struct { Hover Hover // Color is the icon color when not hovered. Color color.NRGBA Size unit.Value Icon widget.Icon // contains filtered or unexported fields }
ClickIcon provides a clickable icon with hover shadow.
type ClickList ¶
ClickList manages a list of clickable items.
func (*ClickList) Layout ¶
func (cl *ClickList) Layout(gtx layout.Context, n int, el ClickElement) layout.Dimensions
type ClickListWrap ¶
type ClickListWrap struct { Hover Hover Separator color.NRGBA List layoutx.ListWrap // contains filtered or unexported fields }
func (*ClickListWrap) Layout ¶
func (cl *ClickListWrap) Layout(gtx layout.Context, n int, el ClickElement) layout.Dimensions
type Draggable ¶
type Draggable struct { Axis gesture.Axis // Ratio is calculated after each layout from gtx.Constraints.Min. // Ratio is always in [0, 1]. Ratio f32.Point // contains filtered or unexported fields }
Draggable makes an area draggable and reports its position in Pos.
type Error ¶
type Error struct { // Error is the error to be displayed. Error error // Show is the duration for which the error is displayed. // If zero, it is displayed until Error is nil. Show time.Duration Text themex.Text Background color.NRGBA // contains filtered or unexported fields }
Error is used to display transient or not transient error message.
type File ¶
type File struct { Palettes struct { // Main is applied to the overall window. Main material.Palette // Area is applied to the individual windows. Area material.Palette // Error is applied to displayed error messages. Error material.Palette } Text struct { Label Label Editor func(layout.Context, *Input) layout.Dimensions } Icons struct { Partitions widget.Icon File widget.Icon Folder widget.Icon Favorite widget.Icon History widget.Icon Selection widget.Icon FavoriteHistory widget.Icon Refresh widget.Icon Expand widget.Icon Collapse widget.Icon Search widget.Icon Close widget.Icon ShowHidden widget.Icon ShowDetails widget.Icon SortAsc widget.Icon SortDesc widget.Icon NewFolder widget.Icon } Hover Hover // Path is the current path. Path string // Selection determines the number and kind of files or directories to be selected. Selection FileSelection // contains filtered or unexported fields }
File provides a way to select a set of files or directories.
type FilePalettes ¶
FilePalettes defines the color palettes for File.
type FileSelection ¶
type FileSelection uint8
FileSelection is the type and number of files to be selected by a File.
const ( SelectFile FileSelection = iota // Single file SelectDirectory // Single directory SelectFiles // SelectFiles SelectDirectories // SelectDirectories )
type Hover ¶
type Hover struct { // Background is the filling color when hovered. Background color.NRGBA // Foreground is the icon color when hovered. Foreground color.NRGBA // Radius is the filling radius. Radius unit.Value }
Hover fills its min area with Background when hovered.
Typical use is with layout.Expanded.
type Icons ¶
type Icons struct { Hover Hover // Color is the icon color when not hovered. Color color.NRGBA Size unit.Value Icons []widget.Icon List layout.List // contains filtered or unexported fields }
Icons represents a toolbar made of icons.
type Input ¶
type Input struct { Padding unit.Value Leading layout.Widget Trailing layout.Widget Editor *widget.Editor NoUnfocus bool // disables ESC to unfocus // contains filtered or unexported fields }
func (*Input) Clear ¶
func (in *Input) Clear()
Clear clears the input text. It does not change the active state.
type ListCue ¶
ListCue provides a shaded bar on the top/bottom or left/right part of a widget based on the Position offsets.
type MenuPopup ¶
type MenuPopup struct { List ClickList Background color.NRGBA Padding unit.Value Border widget.Border // contains filtered or unexported fields }
MenuPopup provides a popup menu.
func (*MenuPopup) Layout ¶
func (pl *MenuPopup) Layout(gtx layout.Context, num int, el layout.ListElement) layout.Dimensions
type Modal ¶
type Modal struct { Background color.NRGBA Keys []string ReleaseMouse bool // contains filtered or unexported fields }
Modal displays a widget and deactivates its background by grabbing keyboard and mouse events as specified by the Release fields.
type Resizable ¶
type Resizable struct { Axis layout.Axis // Ratio defines the ratio between the current position // of the handle and the widget main axis. Ratio is in [0, 1]. Ratio float32 // contains filtered or unexported fields }
Resizable represents an area that can be resized by dragging a handle.
type Select ¶
type Select struct { // Above displays the list above the selected item. // By default it is displayed below. Above bool // contains filtered or unexported fields }
Select displays a single value that can be selected from a set of values.
func (*Select) Layout ¶
func (s *Select) Layout(gtx layout.Context, n int, el ClickElement) layout.Dimensions
Layout displays the currently selected element within the minimum constraints and the list of elements within the maximum constraints if opened.
type Tabs ¶
Tabs allows switching content from a list of label widgets.
func (*Tabs) Layout ¶
func (ts *Tabs) Layout(gtx layout.Context, n int, label, content layout.ListElement) layout.Dimensions
Layout lays out the content and list of labels. content may be called with a negative index if there is no tab at all.
type Tree ¶
type Tree struct { Root func() []int Children func(id int) []int Axis layout.Axis // contains filtered or unexported fields }
Tree is a simple tree data structure that can lay itself out. Tree items are referenced by a unique id. Clicking on an item toggles the visibility of its children.
func (*Tree) Layout ¶
func (t *Tree) Layout(gtx layout.Context, el TreeElement) layout.Dimensions
type TreeElement ¶
TreeElement lays out the TreeNode element.