Documentation ¶
Index ¶
- Constants
- Variables
- func AnyKey(keys ...string) key.Set
- func AnyKeyWithOptionalModifier(modifier key.Modifiers, keys ...string) key.Set
- func Disabled(c color.NRGBA) (d color.NRGBA)
- func DisplayOneDropdown(dropdowns ...*DropDown)
- func Fill(gtx layout.Context, col color.NRGBA) layout.Dimensions
- func FillMax(gtx layout.Context, col color.NRGBA, radius int) layout.Dimensions
- func GenHighlightColor(c color.NRGBA) color.NRGBA
- func GenerateRandomNumber() int
- func HandleEditorEvents(editors ...*widget.Editor) (bool, bool)
- func Hovered(c color.NRGBA) (d color.NRGBA)
- func MustIcon(ic *widget.Icon, err error) *widget.Icon
- func SwitchEditors(event *key.Event, editors ...*widget.Editor)
- type Badge
- type Border
- type Button
- type ButtonLayout
- type C
- type Card
- type CheckBoxStyle
- type Clickable
- func (cl *Clickable) ChangeStyle(style *values.ClickableStyle)
- func (cl *Clickable) Clicked() bool
- func (cl *Clickable) Enabled() bool
- func (cl *Clickable) IsHovered() bool
- func (cl *Clickable) Layout(gtx C, w layout.Widget) D
- func (cl *Clickable) LayoutWithInset(gtx C, w layout.Widget, rightInset, bottomInset unit.Dp) D
- func (cl *Clickable) SetEnabled(enable bool, gtx *layout.Context) layout.Context
- func (cl *Clickable) Style() values.ClickableStyle
- type ClickableInset
- type ClickableList
- type Collapsible
- type CollapsibleWithOption
- type CornerRadius
- type D
- func CentralizeWidget(gtx C, widget layout.Widget) D
- func DisableLayout(currentPage app.Page, gtx C, titleLayout, subtitleLayout func(gtx C) D, ...) D
- func UniformPadding(gtx layout.Context, body layout.Widget, isMobileView ...bool) D
- func UniformPaddingWithTopInset(topInset unit.Dp, gtx layout.Context, body layout.Widget, isMobileView ...bool) D
- type Dragged
- type DropDown
- func (d *DropDown) Changed() bool
- func (d *DropDown) ClearWithSelectedItem(item DropDownItem)
- func (d *DropDown) Items() []DropDownItem
- func (d *DropDown) ItemsLen() int
- func (d *DropDown) Layout(gtx C) D
- func (d *DropDown) Len() int
- func (d *DropDown) Reversed() bool
- func (d *DropDown) Selected() string
- func (d *DropDown) SelectedIndex() int
- func (d *DropDown) SetConvertTextSize(fun func(unit.Sp) unit.Sp)
- func (d *DropDown) SetMaxTextLeng(leng int)
- type DropDownItem
- type Editor
- func (e *Editor) AllowSpaceError(allow bool)
- func (e *Editor) ClearError()
- func (e *Editor) FirstPressed() bool
- func (e *Editor) HasError() bool
- func (e *Editor) IsDirty() bool
- func (e *Editor) Layout(gtx C) D
- func (e *Editor) Pressed() bool
- func (e *Editor) SetError(text string)
- func (e *Editor) SetRequiredErrorText(txt string)
- type Grid
- type GridElement
- type GridLayout
- type GridWrap
- type Hoverable
- type Icon
- type IconButton
- type IconButtonStyle
- type IconPosition
- type IconStyle
- type Icons
- type Image
- func (img *Image) AspectRatio() int
- func (img *Image) Layout12dp(gtx C) D
- func (img *Image) Layout16dp(gtx C) D
- func (img *Image) Layout20dp(gtx C) D
- func (img *Image) Layout24dp(gtx C) D
- func (img *Image) Layout36dp(gtx C) D
- func (img *Image) Layout48dp(gtx C) D
- func (img *Image) Layout8dp(gtx C) D
- func (img *Image) LayoutSize(gtx C, size unit.Dp) D
- func (img *Image) LayoutSize2(gtx C, width, height unit.Dp) D
- func (img *Image) LayoutSizeWithRadius(gtx C, width, height unit.Dp, radius int) D
- func (img *Image) LayoutTransform(gtx C, isMobileView bool, size unit.Dp) D
- type Label
- type Line
- type LinearLayout
- type ListStyle
- type Modal
- func (m *Modal) BackdropClicked(minimizable bool) bool
- func (m *Modal) Dismiss()
- func (m *Modal) IsShown() bool
- func (m *Modal) Layout(gtx C, widgets []layout.Widget, width ...float32) D
- func (m *Modal) SetDisabled(disabled bool)
- func (m *Modal) SetPadding(padding unit.Dp)
- func (m *Modal) ShowScrollbar(showScrollBar bool)
- type MultiLayerProgressBar
- type Outline
- type ProgressBarItem
- type ProgressBarStyle
- type ProgressCircleStyle
- type RadioButton
- type RestoreEditor
- type ScrollbarStyle
- type SegmentType
- type SegmentedControl
- func (sc *SegmentedControl) Changed() bool
- func (sc *SegmentedControl) DisableUniform(disable bool)
- func (sc *SegmentedControl) GroupTileLayout(gtx C) D
- func (sc *SegmentedControl) Layout(gtx C, body func(gtx C) D, isMobileView ...bool) D
- func (sc *SegmentedControl) SelectedIndex() int
- func (sc *SegmentedControl) SelectedSegment() string
- func (sc *SegmentedControl) SetDisableAnimation(disable bool)
- func (sc *SegmentedControl) SetEnableSwipe(enable bool)
- func (sc *SegmentedControl) SetSelectedSegment(segment string)
- type Shadow
- type SlideAction
- type Slider
- type SwipeDirection
- type Switch
- type SwitchButtonText
- type SwitchItem
- type Tab
- type TextAndIconButton
- type Theme
- func (t *Theme) AddBackClick(clickable *widget.Clickable)
- func (t *Theme) AssetIcon(asset utils.AssetType) *Image
- func (t *Theme) AutoHideSoftKeyBoard(gtx C)
- func (t *Theme) Background(gtx layout.Context, w layout.Widget)
- func (t *Theme) Badge() *Badge
- func (t *Theme) Body1(txt string) Label
- func (t *Theme) Body2(txt string) Label
- func (t *Theme) Button(txt string) Button
- func (t *Theme) ButtonLayout() ButtonLayout
- func (t *Theme) Caption(txt string) Label
- func (t *Theme) Card() Card
- func (t *Theme) CheckBox(checkBox *widget.Bool, label string) CheckBoxStyle
- func (t *Theme) Collapsible() *Collapsible
- func (t *Theme) CollapsibleWithOption() *CollapsibleWithOption
- func (t *Theme) DangerButton(text string) Button
- func (t *Theme) DecoratedText(size unit.Sp, txt string, color color.NRGBA, weight font.Weight) Label
- func (t *Theme) DropDown(items []DropDownItem, lastSelectedItem *DropDownItem, group uint, ...) *DropDown
- func (t *Theme) DropdownWithCustomPos(items []DropDownItem, group uint, groupPosition uint, dropdownInset int, ...) *DropDown
- func (t *Theme) Editor(editor *widget.Editor, hint string) Editor
- func (t *Theme) EditorPassword(editor *widget.Editor, hint string) Editor
- func (t *Theme) ErrorLabel(txt string) Label
- func (t *Theme) H1(txt string) Label
- func (t *Theme) H2(txt string) Label
- func (t *Theme) H3(txt string) Label
- func (t *Theme) H4(txt string) Label
- func (t *Theme) H5(txt string) Label
- func (t *Theme) H6(txt string) Label
- func (t *Theme) Hoverable() *Hoverable
- func (t *Theme) IconButton(icon *widget.Icon) IconButton
- func (t *Theme) IconButtonWithStyle(ibs IconButtonStyle, colorStyle *values.ColorStyle) IconButton
- func (t *Theme) IconEditor(editor *widget.Editor, hint string, icon *widget.Icon, clickableIcon bool) Editor
- func (t *Theme) ImageIcon(gtx layout.Context, icon image.Image, size int) layout.Dimensions
- func (t *Theme) Label(size unit.Sp, txt string) Label
- func (t *Theme) Label2(size unit.Sp, txt string) Label
- func (t *Theme) Line(height, width int) Line
- func (t *Theme) List(state *widget.List) ListStyle
- func (t *Theme) Modal(id string, isMobileView bool) *Modal
- func (t *Theme) ModalFloatTitle(id string, isMobileView bool) *Modal
- func (t *Theme) MultiLayerProgressBar(total float64, items []ProgressBarItem) *MultiLayerProgressBar
- func (t *Theme) NewClickable(hoverable bool) *Clickable
- func (t *Theme) NewClickableList(axis layout.Axis) *ClickableList
- func (t *Theme) NewIconButton(icon *widget.Icon, click *widget.Clickable) IconButton
- func (t *Theme) OnTapBack()
- func (t *Theme) Outline() Outline
- func (t *Theme) OutlineButton(txt string) Button
- func (t *Theme) ProgressBar(progress int) ProgressBarStyle
- func (t *Theme) ProgressBarCircle(progress int) ProgressCircleStyle
- func (t *Theme) RadioButton(group *widget.Enum, key, label string, color, icon color.NRGBA) RadioButton
- func (t *Theme) RestoreEditor(editor *widget.Editor, hint string, title string) *RestoreEditor
- func (t *Theme) Scrollbar(state *widget.Scrollbar) ScrollbarStyle
- func (t *Theme) SearchEditor(editor *widget.Editor, hint string, icon *widget.Icon) Editor
- func (t *Theme) SegmentedControl(segmentTitles []string, segmentType SegmentType) *SegmentedControl
- func (t *Theme) SemiBoldLabel(txt string) Label
- func (t *Theme) SemiBoldLabelWithSize(size unit.Sp, txt string) Label
- func (t *Theme) Separator() Line
- func (t *Theme) SeparatorVertical(height, width int) Line
- func (t *Theme) Shadow() *Shadow
- func (t *Theme) Slider() *Slider
- func (t *Theme) Subtitle1(txt string) Label
- func (t *Theme) Surface(gtx layout.Context, w layout.Widget) layout.Dimensions
- func (t *Theme) Switch() *Switch
- func (t *Theme) SwitchButtonText(i []SwitchItem) *SwitchButtonText
- func (t *Theme) SwitchDarkMode(isDarkModeOn bool, decredIcons map[string]image.Image)
- func (t *Theme) Tab(axis layout.Axis, isHoverable bool, tabItems []string) *Tab
- func (t *Theme) TextAndIconButton(text string, icon *widget.Icon) TextAndIconButton
- func (t *Theme) Tooltip() *Tooltip
- func (t *Theme) WatchOnlyAssetIcon(asset utils.AssetType) *Image
- type Tooltip
Constants ¶
const ( WrapContent = -1 MatchParent = -2 )
const (
DropdownBasePos = 0
)
Variables ¶
var MaxWidth = unit.Dp(800)
Functions ¶
func AnyKey ¶
AnyKey returns a key.Set that will match any of the provided keys. See the doc on key.Set for more.
func AnyKeyWithOptionalModifier ¶
AnyKeyWithOptionalModifier returns a key.Set that will match any of the provided keys whether or not they are pressed with provided modifier. See the doc on key.Set for more.
func Disabled ¶
Disabled blends color towards the luminance and multiplies alpha. Blending towards luminance will desaturate the color. Multiplying alpha blends the color together more with the background.
func DisplayOneDropdown ¶
func DisplayOneDropdown(dropdowns ...*DropDown)
Display one dropdown at a time
func GenerateRandomNumber ¶
func GenerateRandomNumber() int
Types ¶
type Border ¶
type Border struct { Color color.NRGBA Radius CornerRadius Width unit.Dp }
Border lays out a widget and draws a border inside it.
type Button ¶
type Button struct { material.ButtonStyle HighlightColor color.NRGBA Margin layout.Inset // contains filtered or unexported fields }
func (*Button) SetClickable ¶
func (*Button) SetEnabled ¶
type ButtonLayout ¶
type ButtonLayout struct {
material.ButtonLayoutStyle
}
func (ButtonLayout) Layout ¶
func (bl ButtonLayout) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
type CheckBoxStyle ¶
type CheckBoxStyle struct {
material.CheckBoxStyle
}
func (CheckBoxStyle) Layout ¶
func (c CheckBoxStyle) Layout(gtx layout.Context) layout.Dimensions
Layout updates the checkBox and displays it.
type Clickable ¶
type Clickable struct { Hoverable bool Radius CornerRadius // contains filtered or unexported fields }
func (*Clickable) ChangeStyle ¶
func (cl *Clickable) ChangeStyle(style *values.ClickableStyle)
func (*Clickable) LayoutWithInset ¶ added in v1.1.0
LayoutWithInset draws a layout of a clickable and applies an hover effect if an hover action is detected. rightInset and bottomInset are used to restrict hover layout and should be supplied ONLY if a right or bottom inset/margin was applied to w.
func (*Clickable) SetEnabled ¶
SetEnabled enables/disables the clickable.
func (*Clickable) Style ¶
func (cl *Clickable) Style() values.ClickableStyle
type ClickableList ¶
type ClickableList struct { layout.List Radius CornerRadius // this radius is used by the clickable DividerHeight unit.Dp IsShadowEnabled bool IsHoverable bool CompleteRadius bool // used to control where to apply the Radius field. ClickableInset ClickableInset // Used to restrict hover layout // contains filtered or unexported fields }
func (*ClickableList) ItemClicked ¶
func (cl *ClickableList) ItemClicked() (bool, int)
func (*ClickableList) Layout ¶
func (cl *ClickableList) Layout(gtx layout.Context, count int, w layout.ListElement) layout.Dimensions
type Collapsible ¶
type Collapsible struct { BackgroundColor color.NRGBA IconStyle IconStyle IconPosition IconPosition // contains filtered or unexported fields }
func (*Collapsible) IsExpanded ¶
func (c *Collapsible) IsExpanded() bool
func (*Collapsible) SetExpanded ¶
func (c *Collapsible) SetExpanded(isExpand bool)
type CollapsibleWithOption ¶
type CollapsibleWithOption struct { BackgroundColor color.NRGBA // contains filtered or unexported fields }
func (*CollapsibleWithOption) MoreTriggered ¶
func (c *CollapsibleWithOption) MoreTriggered() bool
type CornerRadius ¶
func BottomRadius ¶
func BottomRadius(radius int) CornerRadius
func Radius ¶
func Radius(radius int) CornerRadius
func TopRadius ¶
func TopRadius(radius int) CornerRadius
type D ¶
type D = layout.Dimensions
func DisableLayout ¶ added in v1.1.0
func UniformPadding ¶ added in v1.1.0
type Dragged ¶ added in v1.1.0
type Dragged func(dragDirection SwipeDirection)
type DropDown ¶
type DropDown struct { GroupPosition uint Width unit.Dp FontWeight font.Weight BorderWidth unit.Dp BorderColor *color.NRGBA Background *color.NRGBA // SelectedItemIconColor is a custom color that will be applied to the icon // use in identifying selected item when this dropdown is expanded. SelectedItemIconColor *color.NRGBA CollapsedLayoutTextDirection layout.Direction // Set Hoverable to false to make this dropdown's collapsed layout // non-hoverable (default: true). Hoverable bool // Set MakeCollapsedLayoutVisibleWhenExpanded to true to make this // dropdown's collapsed layout visible when its dropdown is expanded. MakeCollapsedLayoutVisibleWhenExpanded bool // ExpandedLayoutInset is information about this dropdown's expanded layout // position. It's Top value must be set if // MakeCollapsedLayoutVisibleWhenExpanded is true. ExpandedLayoutInset layout.Inset // contains filtered or unexported fields }
func ResliceDropdown ¶
Reslice the dropdowns
func (*DropDown) ClearWithSelectedItem ¶ added in v1.1.0
func (d *DropDown) ClearWithSelectedItem(item DropDownItem)
func (*DropDown) Items ¶ added in v1.1.0
func (d *DropDown) Items() []DropDownItem
Items returns the items of the dropdown.
func (*DropDown) SelectedIndex ¶
func (*DropDown) SetConvertTextSize ¶ added in v1.1.0
func (*DropDown) SetMaxTextLeng ¶ added in v1.1.0
type DropDownItem ¶
type DropDownItem struct { Text string Icon *Image // DisplayFn is an alternate display function that can be used to layout the // item instead of using the default item layout. DisplayFn func(gtx C) D // Set to true for items that cannot be selected. PreventSelection bool // contains filtered or unexported fields }
type Editor ¶
type Editor struct { material.EditorStyle TitleLabel Label LineColor color.NRGBA // IsRequired if true, displays a required field text at the bottom of the // editor. IsRequired bool // IsTitleLabel if true makes the title label visible. IsTitleLabel bool HasCustomButton bool CustomButton Button // Set ExtraText to show a custom text in the editor. ExtraText string // Bordered if true makes the adds a border around the editor. Bordered bool EditorIconButtonEvent func() // contains filtered or unexported fields }
func (*Editor) AllowSpaceError ¶ added in v1.1.2
func (*Editor) ClearError ¶
func (e *Editor) ClearError()
func (*Editor) FirstPressed ¶ added in v1.1.2
func (*Editor) SetRequiredErrorText ¶
type Grid ¶
type Grid struct { Num int Axis layout.Axis Alignment layout.Alignment // contains filtered or unexported fields }
Grid lays out at most Num elements along the main axis. The number of cross axis elements depend on the total number of elements.
func (*Grid) Layout ¶
func (g *Grid) Layout(gtx layout.Context, num int, el GridElement) layout.Dimensions
type GridElement ¶
type GridElement func(gtx layout.Context, i int) layout.Dimensions
GridElement lays out the ith element of a Grid.
type GridLayout ¶
type GridLayout struct { List *layout.List HorizontalSpacing layout.Spacing Alignment layout.Alignment Direction layout.Direction RowCount int }
func (GridLayout) Layout ¶
func (g GridLayout) Layout(gtx layout.Context, num int, el GridElement) layout.Dimensions
type GridWrap ¶
GridWrap lays out as many elements as possible along the main axis before wrapping to the cross axis.
func (GridWrap) Layout ¶
func (g GridWrap) Layout(gtx layout.Context, num int, el GridElement) layout.Dimensions
type IconButton ¶
type IconButton struct { IconButtonStyle // contains filtered or unexported fields }
func (IconButton) ChangeColorStyle ¶
func (ib IconButton) ChangeColorStyle(colorStyle *values.ColorStyle)
TODO: Test to ensure this works! TODO: Doesn't work, if ib.colorStyle was nil before this method is called, it is temporarily changed but when ib.Layout is called, it returns to nil.
func (IconButton) Layout ¶
func (ib IconButton) Layout(gtx layout.Context) layout.Dimensions
type IconButtonStyle ¶
type IconButtonStyle struct { Icon *widget.Icon Size unit.Dp Inset layout.Inset Button *widget.Clickable }
IconButtonStyle is similar to material.IconButtonStyle but excluding the color fields. This ensures that the IconButton colors are only set using the IconButton.colorStyle field.
type IconPosition ¶
type IconPosition uint8
const ( // After the chevron icon on the left of the header. After IconPosition = iota // Before sets the chevron icon on the right of the header. Before )
type Icons ¶
type Icons struct {
func (*Icons) DarkModeIcons ¶
func (*Icons) DefaultIcons ¶
func (*Icons) StandardMaterialIcons ¶
TODO: Deprecate some of these standard icons eg ActionInfo
type Image ¶
func (*Image) AspectRatio ¶ added in v1.1.0
func (*Image) Layout12dp ¶
func (*Image) Layout16dp ¶
func (*Image) Layout20dp ¶
func (*Image) Layout24dp ¶
func (*Image) Layout36dp ¶
func (*Image) Layout48dp ¶
func (*Image) Layout8dp ¶ added in v1.1.0
reduced the image original scale of 1 by half to 0.5 fix blurry images this in turn reduced the image layout size by half. Multiplying the layout size by 2 to give the original image size to scale ratio.
func (*Image) LayoutSize2 ¶ added in v1.1.0
func (*Image) LayoutSizeWithRadius ¶ added in v1.1.0
type Label ¶
type Label struct {
material.LabelStyle
}
type Line ¶
type Line struct { Height int Width int Color color.NRGBA // contains filtered or unexported fields }
Line represents a rectangle widget with an initial thickness of 1
type LinearLayout ¶
type LinearLayout struct { Width int Height int Orientation layout.Axis Background color.NRGBA Shadow *Shadow Border Border Margin layout.Inset Padding layout.Inset Direction layout.Direction Spacing layout.Spacing Alignment layout.Alignment Clickable *Clickable }
func (LinearLayout) GradientLayout ¶
type ListStyle ¶
ListStyle configures the presentation of a layout.List with a scrollbar.
func (ListStyle) Layout ¶
func (l ListStyle) Layout(gtx layout.Context, length int, w layout.ListElement) layout.Dimensions
Layout the list and its scrollbar.
type Modal ¶
type Modal struct { // GenericPageModal defines methods such as ID() and OnAttachedToNavigator() // that helps this Modal satisfy the app.Modal interface. It also defines // helper methods for accessing the WindowNavigator that displayed this // modal. *app.GenericPageModal // contains filtered or unexported fields }
func (*Modal) BackdropClicked ¶
func (*Modal) Dismiss ¶
func (m *Modal) Dismiss()
Dismiss removes the modal from the window. Does nothing if the modal was not previously pushed into a window.
func (*Modal) IsShown ¶
IsShown is true if this modal has been pushed into a window and is currently the top modal in the window.
func (*Modal) Layout ¶
Layout renders the modal widget to screen. The modal assumes the size of its content plus padding.
func (*Modal) SetDisabled ¶
func (*Modal) SetPadding ¶
func (*Modal) ShowScrollbar ¶
type MultiLayerProgressBar ¶
type MultiLayerProgressBar struct { Radius CornerRadius Height unit.Dp Width unit.Dp ShowOverLayValue bool ShowOtherWidgetFirst bool // contains filtered or unexported fields }
MultiLayerProgressBar shows the percentage of the mutiple progress layer against the total/expected progress.
type ProgressBarStyle ¶
type ProgressBarStyle struct { Radius CornerRadius Height unit.Dp Width unit.Dp Direction layout.Direction material.ProgressBarStyle }
func (ProgressBarStyle) Layout ¶
func (p ProgressBarStyle) Layout(gtx layout.Context) layout.Dimensions
func (ProgressBarStyle) Layout2 ¶
func (p ProgressBarStyle) Layout2(gtx C) D
This achieves a progress bar using linear layouts.
func (ProgressBarStyle) TextLayout ¶
func (p ProgressBarStyle) TextLayout(gtx C, lbl layout.Widget) D
This achieves a progress bar using linear layouts.
type ProgressCircleStyle ¶
type ProgressCircleStyle struct {
material.ProgressCircleStyle
}
func (ProgressCircleStyle) Layout ¶
func (p ProgressCircleStyle) Layout(gtx layout.Context) layout.Dimensions
type RadioButton ¶
type RadioButton struct {
material.RadioButtonStyle
}
type RestoreEditor ¶
type RestoreEditor struct { Edit *Editor TitleLabel Label LineColor color.NRGBA // contains filtered or unexported fields }
func (RestoreEditor) Layout ¶
func (re RestoreEditor) Layout(gtx C) D
type ScrollbarStyle ¶
type ScrollbarStyle struct {
material.ScrollbarStyle
}
ScrollbarStyle configures the presentation of a scrollbar.
type SegmentType ¶ added in v1.1.0
type SegmentType int
const ( SegmentTypeGroup SegmentType = iota SegmentTypeSplit SegmentTypeGroupMax SegmentTypeDynamicSplit )
type SegmentedControl ¶ added in v1.1.0
type SegmentedControl struct { Padding layout.Inset ContentPadding layout.Inset Alignment layout.Alignment // contains filtered or unexported fields }
func (*SegmentedControl) Changed ¶ added in v1.1.0
func (sc *SegmentedControl) Changed() bool
func (*SegmentedControl) DisableUniform ¶ added in v1.1.0
func (sc *SegmentedControl) DisableUniform(disable bool)
func (*SegmentedControl) GroupTileLayout ¶ added in v1.1.0
func (sc *SegmentedControl) GroupTileLayout(gtx C) D
func (*SegmentedControl) Layout ¶ added in v1.1.0
Layout handles the segmented control's layout, it receives an optional isMobileView bool parameter which is used to determine if the segmented control should be displayed in mobile view or not. If the parameter is not provided, isMobileView defaults to false.
func (*SegmentedControl) SelectedIndex ¶ added in v1.1.0
func (sc *SegmentedControl) SelectedIndex() int
func (*SegmentedControl) SelectedSegment ¶ added in v1.1.0
func (sc *SegmentedControl) SelectedSegment() string
func (*SegmentedControl) SetDisableAnimation ¶ added in v1.1.0
func (sc *SegmentedControl) SetDisableAnimation(disable bool)
func (*SegmentedControl) SetEnableSwipe ¶ added in v1.1.0
func (sc *SegmentedControl) SetEnableSwipe(enable bool)
func (*SegmentedControl) SetSelectedSegment ¶ added in v1.1.0
func (sc *SegmentedControl) SetSelectedSegment(segment string)
type Shadow ¶
type Shadow struct {
// contains filtered or unexported fields
}
func (*Shadow) SetShadowElevation ¶
func (*Shadow) SetShadowRadius ¶
type SlideAction ¶ added in v1.1.0
type SlideAction struct { Duration time.Duration IsReverse bool // contains filtered or unexported fields }
func NewSlideAction ¶ added in v1.1.0
func NewSlideAction() *SlideAction
func (*SlideAction) DragLayout ¶ added in v1.1.0
func (s *SlideAction) DragLayout(gtx C, w layout.Widget) D
func (*SlideAction) Draged ¶ added in v1.1.0
func (s *SlideAction) Draged(drag Dragged)
func (*SlideAction) PushLeft ¶ added in v1.1.0
func (s *SlideAction) PushLeft()
PushLeft pushes the existing widget to the left.
func (*SlideAction) PushRight ¶ added in v1.1.0
func (s *SlideAction) PushRight()
PushRight pushes the existing widget to the right.
func (*SlideAction) SetDragEffect ¶ added in v1.1.0
func (s *SlideAction) SetDragEffect(offset int)
func (*SlideAction) TransformLayout ¶ added in v1.1.0
func (s *SlideAction) TransformLayout(gtx C, w layout.Widget) D
TransformLayout perform transition effects between 2 widgets
type Slider ¶ added in v1.1.0
type Slider struct { // colors of the indicator and navigation button ButtonBackgroundColor color.NRGBA IndicatorBackgroundColor color.NRGBA SelectedIndicatorColor color.NRGBA // this is a full color no opacity ControlInset layout.Inset // contains filtered or unexported fields }
func (*Slider) GetSelectedIndex ¶ added in v1.1.0
GetSelectedIndex returns the index of the current slider item.
func (*Slider) RefreshItems ¶ added in v1.1.0
func (s *Slider) RefreshItems()
func (*Slider) SetDisableDirectionBtn ¶ added in v1.1.2
type SwipeDirection ¶ added in v1.1.0
type SwipeDirection int
const ( SwipeLeft SwipeDirection = iota SwipeRight )
type Switch ¶
type Switch struct {
// contains filtered or unexported fields
}
func (*Switch) SetChecked ¶
func (*Switch) SetEnabled ¶
type SwitchButtonText ¶
type SwitchButtonText struct {
ActiveTextColor, InactiveTextColor color.NRGBA
Active, Inactive color.NRGBA
// contains filtered or unexported fields
}
func (*SwitchButtonText) Changed ¶
func (s *SwitchButtonText) Changed() bool
func (*SwitchButtonText) Layout ¶
func (s *SwitchButtonText) Layout(gtx layout.Context) layout.Dimensions
func (*SwitchButtonText) SelectedIndex ¶
func (s *SwitchButtonText) SelectedIndex() int
func (*SwitchButtonText) SelectedOption ¶
func (s *SwitchButtonText) SelectedOption() string
func (*SwitchButtonText) SetSelectedIndex ¶
func (s *SwitchButtonText) SetSelectedIndex(index int)
type SwitchItem ¶
type SwitchItem struct { Text string // contains filtered or unexported fields }
type Tab ¶ added in v1.1.0
type Tab struct {
// contains filtered or unexported fields
}
func (*Tab) SelectedIndex ¶ added in v1.1.0
func (*Tab) SelectedTab ¶ added in v1.1.0
func (*Tab) SetSelectedTab ¶ added in v1.1.0
type TextAndIconButton ¶
type TextAndIconButton struct { Button *widget.Clickable Color color.NRGBA BackgroundColor color.NRGBA // contains filtered or unexported fields }
func (TextAndIconButton) Layout ¶
func (b TextAndIconButton) Layout(gtx layout.Context) layout.Dimensions
type Theme ¶
type Theme struct { Shaper text.Shaper Base *material.Theme Color *values.Color Styles *values.WidgetStyles Icons *Icons TextSize unit.Sp DropdownBackdrop *widget.Clickable // contains filtered or unexported fields }
func (*Theme) AddBackClick ¶ added in v1.1.0
func (*Theme) AutoHideSoftKeyBoard ¶ added in v1.1.0
func (*Theme) ButtonLayout ¶
func (t *Theme) ButtonLayout() ButtonLayout
func (*Theme) CheckBox ¶
func (t *Theme) CheckBox(checkBox *widget.Bool, label string) CheckBoxStyle
func (*Theme) Collapsible ¶
func (t *Theme) Collapsible() *Collapsible
func (*Theme) CollapsibleWithOption ¶
func (t *Theme) CollapsibleWithOption() *CollapsibleWithOption
func (*Theme) DangerButton ¶
DangerButton a button with the background set to theme.Danger
func (*Theme) DecoratedText ¶ added in v1.1.0
func (*Theme) DropDown ¶
func (t *Theme) DropDown(items []DropDownItem, lastSelectedItem *DropDownItem, group uint, reversePos bool) *DropDown
DropDown is like DropdownWithCustomPos but uses default values for groupPosition, and dropdownInset parameters. Provide lastSelectedItem to select the item that matches the lastSelectedItem parameter. It's a no-op if the item is not found or if the item has PreventSelection set to true.
func (*Theme) DropdownWithCustomPos ¶ added in v1.1.0
func (t *Theme) DropdownWithCustomPos(items []DropDownItem, group uint, groupPosition uint, dropdownInset int, reversePos bool) *DropDown
DropdownWithCustomPos returns a dropdown component. {groupPosition} parameter signifies the position of the dropdown in a dropdown group on the UI, the first dropdown should be assigned pos 0, next 1..etc. incorrectly assigned Dropdown pos will result in inconsistent dropdown backdrop. {dropdownInset} parameter is the left inset for the dropdown if {reversePos} is false, else it'll become the right inset for the dropdown.
func (*Theme) EditorPassword ¶
func (*Theme) ErrorLabel ¶
func (*Theme) IconButton ¶
func (t *Theme) IconButton(icon *widget.Icon) IconButton
func (*Theme) IconButtonWithStyle ¶
func (t *Theme) IconButtonWithStyle(ibs IconButtonStyle, colorStyle *values.ColorStyle) IconButton
func (*Theme) IconEditor ¶
func (t *Theme) IconEditor(editor *widget.Editor, hint string, icon *widget.Icon, clickableIcon bool) Editor
IconEditor creates an editor widget with icon of choice
func (*Theme) ModalFloatTitle ¶
func (*Theme) MultiLayerProgressBar ¶
func (t *Theme) MultiLayerProgressBar(total float64, items []ProgressBarItem) *MultiLayerProgressBar
func (*Theme) NewClickable ¶
func (*Theme) NewClickableList ¶
func (t *Theme) NewClickableList(axis layout.Axis) *ClickableList
func (*Theme) NewIconButton ¶ added in v1.1.0
func (*Theme) OutlineButton ¶
func (*Theme) ProgressBar ¶
func (t *Theme) ProgressBar(progress int) ProgressBarStyle
func (*Theme) ProgressBarCircle ¶ added in v1.1.0
func (t *Theme) ProgressBarCircle(progress int) ProgressCircleStyle
func (*Theme) RadioButton ¶
func (t *Theme) RadioButton(group *widget.Enum, key, label string, color, icon color.NRGBA) RadioButton
RadioButton returns a RadioButton with a label. The key specifies the value for the Enum.
func (*Theme) RestoreEditor ¶
func (*Theme) SearchEditor ¶ added in v1.1.0
func (*Theme) SegmentedControl ¶ added in v1.1.0
func (t *Theme) SegmentedControl(segmentTitles []string, segmentType SegmentType) *SegmentedControl
Segmented control is a linear set of two or more segments, each of which functions as a button.
func (*Theme) SemiBoldLabel ¶ added in v1.1.0
func (*Theme) SemiBoldLabelWithSize ¶ added in v1.1.0
func (*Theme) SeparatorVertical ¶
SeparatorVertical returns a vertical line widget instance
func (*Theme) SwitchButtonText ¶
func (t *Theme) SwitchButtonText(i []SwitchItem) *SwitchButtonText
func (*Theme) SwitchDarkMode ¶
func (*Theme) TextAndIconButton ¶
func (t *Theme) TextAndIconButton(text string, icon *widget.Icon) TextAndIconButton
Source Files ¶
- badge.go
- border.go
- button.go
- card.go
- checkbox.go
- clickable.go
- clickable_list.go
- collapsible.go
- dropdown.go
- editor.go
- grid.go
- gridlayout.go
- hoverable.go
- icon.go
- icon_gallery.go
- image.go
- label.go
- line.go
- linearlayout.go
- list_scroll.go
- modal.go
- outline.go
- progressbar.go
- radiobutton.go
- segmented_control.go
- shadow.go
- slide_action.go
- slider.go
- switch.go
- tab.go
- theme.go
- tooltip.go
- util.go