cryptomaterial

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: ISC Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WrapContent = -1
	MatchParent = -2
)
View Source
const (
	DropdownBasePos = 0
)

Variables

View Source
var MaxWidth = unit.Dp(800)

Functions

func AnyKey

func AnyKey(keys ...string) key.Set

AnyKey returns a key.Set that will match any of the provided keys. See the doc on key.Set for more.

func AnyKeyWithOptionalModifier

func AnyKeyWithOptionalModifier(modifier key.Modifiers, keys ...string) key.Set

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

func Disabled(c color.NRGBA) (d color.NRGBA)

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 Fill

func Fill(gtx layout.Context, col color.NRGBA) layout.Dimensions

func FillMax

func FillMax(gtx layout.Context, col color.NRGBA, radius int) layout.Dimensions

func GenHighlightColor

func GenHighlightColor(c color.NRGBA) color.NRGBA

func GenerateRandomNumber

func GenerateRandomNumber() int

func HandleEditorEvents

func HandleEditorEvents(editors ...*widget.Editor) (bool, bool)

func Hovered

func Hovered(c color.NRGBA) (d color.NRGBA)

Hovered blends color towards a brighter color.

func MustIcon

func MustIcon(ic *widget.Icon, err error) *widget.Icon

func SwitchEditors

func SwitchEditors(event *key.Event, editors ...*widget.Editor)

Types

type Badge

type Badge struct {
	Background color.NRGBA
}

func (*Badge) Layout

func (b *Badge) Layout(gtx C, label Label) D

type Border

type Border struct {
	Color  color.NRGBA
	Radius CornerRadius
	Width  unit.Dp
}

Border lays out a widget and draws a border inside it.

func (Border) Layout

func (b Border) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

type Button

type Button struct {
	material.ButtonStyle

	HighlightColor color.NRGBA

	Margin layout.Inset
	// contains filtered or unexported fields
}

func (Button) Click

func (b Button) Click()

func (Button) Clicked

func (b Button) Clicked() bool

func (*Button) Enabled

func (b *Button) Enabled() bool

func (Button) Hovered

func (b Button) Hovered() bool

func (*Button) Layout

func (b *Button) Layout(gtx layout.Context) layout.Dimensions

func (*Button) SetClickable

func (b *Button) SetClickable(clickable *widget.Clickable)

func (*Button) SetEnabled

func (b *Button) SetEnabled(enabled bool)

type ButtonLayout

type ButtonLayout struct {
	material.ButtonLayoutStyle
}

func (ButtonLayout) Layout

type C

type C = layout.Context

type Card

type Card struct {
	layout.Inset
	Color      color.NRGBA
	HoverColor color.NRGBA
	Radius     CornerRadius
}

func (Card) GradientLayout

func (c Card) GradientLayout(gtx layout.Context, w layout.Widget) layout.Dimensions

func (Card) HoverableLayout

func (c Card) HoverableLayout(gtx layout.Context, btn *Clickable, w layout.Widget) layout.Dimensions

func (Card) Layout

func (c Card) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

type CheckBoxStyle

type CheckBoxStyle struct {
	material.CheckBoxStyle
}

func (CheckBoxStyle) Layout

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) Clicked

func (cl *Clickable) Clicked() bool

func (*Clickable) Enabled

func (cl *Clickable) Enabled() bool

Return clickable enabled/disabled state.

func (*Clickable) IsHovered

func (cl *Clickable) IsHovered() bool

func (*Clickable) Layout

func (cl *Clickable) Layout(gtx C, w layout.Widget) D

func (*Clickable) LayoutWithInset added in v1.1.0

func (cl *Clickable) LayoutWithInset(gtx C, w layout.Widget, rightInset, bottomInset unit.Dp) D

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

func (cl *Clickable) SetEnabled(enable bool, gtx *layout.Context) layout.Context

SetEnabled enables/disables the clickable.

func (*Clickable) Style

func (cl *Clickable) Style() values.ClickableStyle

type ClickableInset added in v1.1.0

type ClickableInset struct {
	Right  unit.Dp
	Bottom unit.Dp
}

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) Layout

func (c *Collapsible) Layout(gtx C, header, body func(C) D) D

func (*Collapsible) SetExpanded

func (c *Collapsible) SetExpanded(isExpand bool)

type CollapsibleWithOption

type CollapsibleWithOption struct {
	BackgroundColor color.NRGBA
	// contains filtered or unexported fields
}

func (*CollapsibleWithOption) Layout

func (c *CollapsibleWithOption) Layout(gtx C, header, body func(C) D, more func(C), rowID int) D

func (*CollapsibleWithOption) MoreTriggered

func (c *CollapsibleWithOption) MoreTriggered() bool

type CornerRadius

type CornerRadius struct {
	TopLeft     int
	TopRight    int
	BottomRight int
	BottomLeft  int
}

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 CentralizeWidget added in v1.1.0

func CentralizeWidget(gtx C, widget layout.Widget) D

func DisableLayout added in v1.1.0

func DisableLayout(currentPage app.Page, gtx C, titleLayout, subtitleLayout func(gtx C) D, transparency uint8, color color.NRGBA, actionButton *Button) D

func UniformPadding added in v1.1.0

func UniformPadding(gtx layout.Context, body layout.Widget, isMobileView ...bool) D

func UniformPaddingWithTopInset added in v1.1.0

func UniformPaddingWithTopInset(topInset unit.Dp, gtx layout.Context, body layout.Widget, isMobileView ...bool) D

type Dragged added in v1.1.0

type Dragged func(dragDirection SwipeDirection)
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

func ResliceDropdown(dropdowns []*DropDown, indexToRemove int) []*DropDown

Reslice the dropdowns

func (d *DropDown) Changed() bool
func (d *DropDown) ClearWithSelectedItem(item DropDownItem)
func (d *DropDown) Items() []DropDownItem

Items returns the items of the dropdown.

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 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 (e *Editor) AllowSpaceError(allow bool)

func (*Editor) ClearError

func (e *Editor) ClearError()

func (*Editor) FirstPressed added in v1.1.2

func (e *Editor) FirstPressed() bool

func (*Editor) HasError added in v1.1.2

func (e *Editor) HasError() bool

func (*Editor) IsDirty

func (e *Editor) IsDirty() bool

func (*Editor) Layout

func (e *Editor) Layout(gtx C) D

func (*Editor) Pressed added in v1.1.0

func (e *Editor) Pressed() bool

func (*Editor) SetError

func (e *Editor) SetError(text string)

func (*Editor) SetRequiredErrorText

func (e *Editor) SetRequiredErrorText(txt string)

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

type GridWrap struct {
	Axis      layout.Axis
	Alignment layout.Alignment
}

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 Hoverable

type Hoverable struct {
	// contains filtered or unexported fields
}

func (*Hoverable) Hovered

func (h *Hoverable) Hovered() bool

func (*Hoverable) Layout

func (h *Hoverable) Layout(gtx C, rect image.Rectangle) D

func (*Hoverable) Position

func (h *Hoverable) Position() *f32.Point

type Icon

type Icon struct {
	*widget.Icon
	Color color.NRGBA
}

func NewIcon

func NewIcon(icon *widget.Icon) *Icon

NewIcon returns a new Icon from IconVG data.

func (*Icon) Layout

func (icon *Icon) Layout(gtx C, iconSize unit.Dp) D

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 IconStyle

type IconStyle uint8
const (
	// Chevron sets the icon design chevron icon.
	Chevron IconStyle = iota
	// Caret sets the  the icon design to caret icon.
	Caret
)

type Icons

type Icons struct {
	ContentAdd, NavigationCheck, NavigationMore, ActionCheckCircle, ActionInfo, NavigationArrowBack,
	NavigationArrowForward, ActionCheck, NavigationCancel, NavMoreIcon,
	DotIcon, ContentClear, DropDownIcon, Cached, ContentRemove, SearchIcon, PlayIcon,
	ActionSettings, ActionSwapHoriz, ActionSwapVertical, NavigationRefresh, ContentCopy *widget.Icon

	OverviewIcon, OverviewIconInactive, WalletIcon, WalletIconInactive, TradeIconActive, TradeIconInactive, MixerInactive, RedAlert, Alert,
	ReceiveIcon, Transferred, TransactionsIcon, TransactionsIconInactive, SendIcon, MoreIcon, MoreIconInactive,

func (*Icons) DarkModeIcons

func (i *Icons) DarkModeIcons() *Icons

func (*Icons) DefaultIcons

func (i *Icons) DefaultIcons() *Icons

func (*Icons) StandardMaterialIcons

func (i *Icons) StandardMaterialIcons() *Icons

TODO: Deprecate some of these standard icons eg ActionInfo

type Image

type Image struct {
	image.Image
	// contains filtered or unexported fields
}

func NewImage

func NewImage(src image.Image) *Image

func (*Image) AspectRatio added in v1.1.0

func (img *Image) AspectRatio() int

func (*Image) Layout12dp

func (img *Image) Layout12dp(gtx C) D

func (*Image) Layout16dp

func (img *Image) Layout16dp(gtx C) D

func (*Image) Layout20dp

func (img *Image) Layout20dp(gtx C) D

func (*Image) Layout24dp

func (img *Image) Layout24dp(gtx C) D

func (*Image) Layout36dp

func (img *Image) Layout36dp(gtx C) D

func (*Image) Layout48dp

func (img *Image) Layout48dp(gtx C) D

func (*Image) Layout8dp added in v1.1.0

func (img *Image) Layout8dp(gtx C) D

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) LayoutSize

func (img *Image) LayoutSize(gtx C, size unit.Dp) D

func (*Image) LayoutSize2 added in v1.1.0

func (img *Image) LayoutSize2(gtx C, width, height unit.Dp) D

func (*Image) LayoutSizeWithRadius added in v1.1.0

func (img *Image) LayoutSizeWithRadius(gtx C, width, height unit.Dp, radius int) D

func (*Image) LayoutTransform added in v1.1.0

func (img *Image) LayoutTransform(gtx C, isMobileView bool, size unit.Dp) D

LayoutTransform is used to scale images for mobile view.

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

func (Line) Layout

func (l Line) Layout(gtx C) D

Layout renders the line widget

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

func (ll LinearLayout) GradientLayout(gtx C, assetType utils.AssetType, children ...layout.FlexChild) D

func (LinearLayout) Layout

func (ll LinearLayout) Layout(gtx C, children ...layout.FlexChild) D

func (LinearLayout) Layout2

func (ll LinearLayout) Layout2(gtx C, wdg layout.Widget) D

Layout2 displays a linear layout with a single child.

type ListStyle

type ListStyle struct {
	material.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 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 (m *Modal) BackdropClicked(minimizable bool) bool

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

func (m *Modal) IsShown() bool

IsShown is true if this modal has been pushed into a window and is currently the top modal in the window.

func (*Modal) Layout

func (m *Modal) Layout(gtx C, widgets []layout.Widget, width ...float32) D

Layout renders the modal widget to screen. The modal assumes the size of its content plus padding.

func (*Modal) SetDisabled

func (m *Modal) SetDisabled(disabled bool)

func (*Modal) SetPadding

func (m *Modal) SetPadding(padding unit.Dp)

func (*Modal) ShowScrollbar

func (m *Modal) ShowScrollbar(showScrollBar bool)

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.

func (*MultiLayerProgressBar) Layout

func (mp *MultiLayerProgressBar) Layout(gtx C, isMobileView bool, additionalWidget layout.Widget) D

type Outline

type Outline struct {
	BorderColor color.NRGBA
	Weight      int
}

func (Outline) Layout

func (o Outline) Layout(gtx layout.Context, w layout.Widget) D

type ProgressBarItem

type ProgressBarItem struct {
	Value float64
	Color color.NRGBA
	Label Label
}

type ProgressBarStyle

type ProgressBarStyle struct {
	Radius    CornerRadius
	Height    unit.Dp
	Width     unit.Dp
	Direction layout.Direction
	material.ProgressBarStyle
}

func (ProgressBarStyle) Layout

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

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

func (sc *SegmentedControl) Layout(gtx C, body func(gtx C) D, isMobileView ...bool) D

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) Layout

func (s *Shadow) Layout(gtx C, w layout.Widget) D

func (*Shadow) SetShadowElevation

func (s *Shadow) SetShadowElevation(elev float32)

func (*Shadow) SetShadowRadius

func (s *Shadow) SetShadowRadius(radius float32)

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) Clicked added in v1.1.0

func (s *Slider) Clicked() bool

func (*Slider) GetSelectedIndex added in v1.1.0

func (s *Slider) GetSelectedIndex() int

GetSelectedIndex returns the index of the current slider item.

func (*Slider) Layout added in v1.1.0

func (s *Slider) Layout(gtx C, items []layout.Widget) D

func (*Slider) RefreshItems added in v1.1.0

func (s *Slider) RefreshItems()

func (*Slider) SetDisableDirectionBtn added in v1.1.2

func (s *Slider) SetDisableDirectionBtn(disable bool)

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) Changed

func (s *Switch) Changed() bool

func (*Switch) IsChecked

func (s *Switch) IsChecked() bool

func (*Switch) Layout

func (s *Switch) Layout(gtx layout.Context) layout.Dimensions

func (*Switch) SetChecked

func (s *Switch) SetChecked(value bool)

func (*Switch) SetEnabled

func (s *Switch) SetEnabled(value bool)

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 (*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) Changed added in v1.1.0

func (tn *Tab) Changed() bool

func (*Tab) Layout added in v1.1.0

func (tn *Tab) Layout(gtx C) D

func (*Tab) SelectedIndex added in v1.1.0

func (tn *Tab) SelectedIndex() int

func (*Tab) SelectedTab added in v1.1.0

func (tn *Tab) SelectedTab() string

func (*Tab) SetSelectedTab added in v1.1.0

func (tn *Tab) SetSelectedTab(tab string)

type TextAndIconButton

type TextAndIconButton struct {
	Button *widget.Clickable

	Color           color.NRGBA
	BackgroundColor color.NRGBA
	// contains filtered or unexported fields
}

func (TextAndIconButton) Layout

type Theme

type Theme struct {
	Shaper text.Shaper
	Base   *material.Theme
	Color  *values.Color
	Styles *values.WidgetStyles

	Icons    *Icons
	TextSize unit.Sp

	NavMoreIcon *widget.Icon

	DropdownBackdrop *widget.Clickable
	// contains filtered or unexported fields
}

func NewTheme

func NewTheme(fontCollection []text.FontFace, decredIcons map[string]image.Image, isDarkModeOn bool) *Theme

func (*Theme) AddBackClick added in v1.1.0

func (t *Theme) AddBackClick(clickable *widget.Clickable)

func (*Theme) AssetIcon added in v1.1.0

func (t *Theme) AssetIcon(asset utils.AssetType) *Image

func (*Theme) AutoHideSoftKeyBoard added in v1.1.0

func (t *Theme) AutoHideSoftKeyBoard(gtx C)

func (*Theme) Background

func (t *Theme) Background(gtx layout.Context, w layout.Widget)

func (*Theme) Badge

func (t *Theme) Badge() *Badge

func (*Theme) Body1

func (t *Theme) Body1(txt string) Label

func (*Theme) Body2

func (t *Theme) Body2(txt string) Label

func (*Theme) Button

func (t *Theme) Button(txt string) Button

func (*Theme) ButtonLayout

func (t *Theme) ButtonLayout() ButtonLayout

func (*Theme) Caption

func (t *Theme) Caption(txt string) Label

func (*Theme) Card

func (t *Theme) Card() Card

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

func (t *Theme) DangerButton(text string) Button

DangerButton a button with the background set to theme.Danger

func (*Theme) DecoratedText added in v1.1.0

func (t *Theme) DecoratedText(size unit.Sp, txt string, color color.NRGBA, weight font.Weight) Label

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) Editor

func (t *Theme) Editor(editor *widget.Editor, hint string) Editor

func (*Theme) EditorPassword

func (t *Theme) EditorPassword(editor *widget.Editor, hint string) Editor

func (*Theme) ErrorLabel

func (t *Theme) ErrorLabel(txt string) Label

func (*Theme) H1

func (t *Theme) H1(txt string) Label

func (*Theme) H2

func (t *Theme) H2(txt string) Label

func (*Theme) H3

func (t *Theme) H3(txt string) Label

func (*Theme) H4

func (t *Theme) H4(txt string) Label

func (*Theme) H5

func (t *Theme) H5(txt string) Label

func (*Theme) H6

func (t *Theme) H6(txt string) Label

func (*Theme) Hoverable

func (t *Theme) Hoverable() *Hoverable

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) ImageIcon

func (t *Theme) ImageIcon(gtx layout.Context, icon image.Image, size int) layout.Dimensions

func (*Theme) Label

func (t *Theme) Label(size unit.Sp, txt string) Label

func (*Theme) Label2 added in v1.1.0

func (t *Theme) Label2(size unit.Sp, txt string) Label

func (*Theme) Line

func (t *Theme) Line(height, width int) Line

Line returns a line widget instance

func (*Theme) List

func (t *Theme) List(state *widget.List) ListStyle

func (*Theme) Modal

func (t *Theme) Modal(id string, isMobileView bool) *Modal

func (*Theme) ModalFloatTitle

func (t *Theme) ModalFloatTitle(id string, isMobileView bool) *Modal

func (*Theme) MultiLayerProgressBar

func (t *Theme) MultiLayerProgressBar(total float64, items []ProgressBarItem) *MultiLayerProgressBar

func (*Theme) NewClickable

func (t *Theme) NewClickable(hoverable bool) *Clickable

func (*Theme) NewClickableList

func (t *Theme) NewClickableList(axis layout.Axis) *ClickableList

func (*Theme) NewIconButton added in v1.1.0

func (t *Theme) NewIconButton(icon *widget.Icon, click *widget.Clickable) IconButton

func (*Theme) OnTapBack added in v1.1.0

func (t *Theme) OnTapBack()

func (*Theme) Outline

func (t *Theme) Outline() Outline

func (*Theme) OutlineButton

func (t *Theme) OutlineButton(txt string) Button

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 (t *Theme) RestoreEditor(editor *widget.Editor, hint string, title string) *RestoreEditor

func (*Theme) Scrollbar

func (t *Theme) Scrollbar(state *widget.Scrollbar) ScrollbarStyle

func (*Theme) SearchEditor added in v1.1.0

func (t *Theme) SearchEditor(editor *widget.Editor, hint string, icon *widget.Icon) Editor

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 (t *Theme) SemiBoldLabel(txt string) Label

func (*Theme) SemiBoldLabelWithSize added in v1.1.0

func (t *Theme) SemiBoldLabelWithSize(size unit.Sp, txt string) Label

func (*Theme) Separator

func (t *Theme) Separator() Line

func (*Theme) SeparatorVertical

func (t *Theme) SeparatorVertical(height, width int) Line

SeparatorVertical returns a vertical line widget instance

func (*Theme) Shadow

func (t *Theme) Shadow() *Shadow

func (*Theme) Slider added in v1.1.0

func (t *Theme) Slider() *Slider

func (*Theme) Subtitle1 added in v1.1.0

func (t *Theme) Subtitle1(txt string) Label

func (*Theme) Surface

func (t *Theme) Surface(gtx layout.Context, w layout.Widget) layout.Dimensions

func (*Theme) Switch

func (t *Theme) Switch() *Switch

func (*Theme) SwitchButtonText

func (t *Theme) SwitchButtonText(i []SwitchItem) *SwitchButtonText

func (*Theme) SwitchDarkMode

func (t *Theme) SwitchDarkMode(isDarkModeOn bool, decredIcons map[string]image.Image)

func (*Theme) Tab added in v1.1.0

func (t *Theme) Tab(axis layout.Axis, isHoverable bool, tabItems []string) *Tab

func (*Theme) TextAndIconButton

func (t *Theme) TextAndIconButton(text string, icon *widget.Icon) TextAndIconButton

func (*Theme) Tooltip

func (t *Theme) Tooltip() *Tooltip

func (*Theme) WatchOnlyAssetIcon added in v1.1.2

func (t *Theme) WatchOnlyAssetIcon(asset utils.AssetType) *Image

WatchOnlyAssetIcon returns the icon for a watch only wallet.

type Tooltip

type Tooltip struct {
	// contains filtered or unexported fields
}

func (*Tooltip) Layout

func (t *Tooltip) Layout(gtx C, rect image.Rectangle, pos layout.Inset, wdgt layout.Widget) D

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL