Documentation
¶
Index ¶
- type Button
- type ButtonAnimation
- type ButtonColors
- type ButtonStyle
- type DragItems
- type Fit
- type HoldPress
- type Image
- type Input
- type InputColors
- type Modal
- type ModalAnimation
- type ModalColors
- type ModalStyle
- type NotificationColors
- type NotificationModal
- type NotificationStyle
- type ProgressBar
- type ProgressBarColors
- type Rounded
- type TabBars
- type TabBarsColors
- type TabBarsItem
- type Transform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Button ¶
type Button struct { Text string Style ButtonStyle Clickable *widget.Clickable Label *widget.Label Focused bool Disabled bool Loading bool Flex bool // contains filtered or unexported fields }
func NewButton ¶
func NewButton(style ButtonStyle) *Button
func (*Button) SetLoading ¶
type ButtonAnimation ¶
type ButtonAnimation struct {
// contains filtered or unexported fields
}
func NewButtonAnimationDefault ¶
func NewButtonAnimationDefault() ButtonAnimation
func NewButtonAnimationScale ¶
func NewButtonAnimationScale(v float32) ButtonAnimation
type ButtonColors ¶
type ButtonStyle ¶
type DragItems ¶
type DragItems struct {
// contains filtered or unexported fields
}
func NewDragItems ¶
func NewDragItems() *DragItems
type Fit ¶
type Fit uint8
Fit scales a widget to fit and clip to the constraints.
const ( // Unscaled does not alter the scale of a widget. Unscaled Fit = iota // Contain scales widget as large as possible without cropping // and it preserves aspect-ratio. Contain // Cover scales the widget to cover the constraint area and // preserves aspect-ratio. Cover // ScaleDown scales the widget smaller without cropping, // when it exceeds the constraint area. // It preserves aspect-ratio. ScaleDown // Fill stretches the widget to the constraints and does not // preserve aspect-ratio. Fill )
type HoldPress ¶
type HoldPress struct { TriggerDuration time.Duration Triggered bool // contains filtered or unexported fields }
func NewHoldPress ¶
type Image ¶
type Image struct { // Src is the image to display. Src paint.ImageOp // Fit specifies how to scale the image to the constraints. // By default it does not do any scaling. Fit Fit // Position specifies where to position the image within // the constraints. Position layout.Direction // Scale is the factor used for converting image pixels to dp. // If Scale is zero it defaults to 1. // // To map one image pixel to one output pixel, set Scale to 1.0 / gtx.Metric.PxPerDp. Scale float32 Rounded Rounded }
Image is a widget that displays an image.
type Input ¶
type Input struct { FontWeight font.Weight TextSize unit.Sp Editor *widget.Editor EditorMinY int Border widget.Border Inset layout.Inset Clickable *widget.Clickable Colors InputColors // contains filtered or unexported fields }
func NewNumberInput ¶
func NewNumberInput() *Input
func NewPasswordInput ¶
func NewPasswordInput() *Input
func (*Input) Submitted ¶
submit is lock by a mutex to avoid multiple calls because it work with press and not release key.release is not implemented for mobile app you have to call UnlockSubmit after a submit
func (*Input) UnlockSubmit ¶
func (t *Input) UnlockSubmit()
type InputColors ¶
type Modal ¶
type Modal struct { Style ModalStyle Visible bool CloseKeySet key.Set // contains filtered or unexported fields }
func NewModal ¶
func NewModal(style ModalStyle) *Modal
func (*Modal) SetVisible ¶
type ModalAnimation ¶
type ModalAnimation struct {
// contains filtered or unexported fields
}
func NewModalAnimationDown ¶
func NewModalAnimationDown() ModalAnimation
func NewModalAnimationScaleBounce ¶
func NewModalAnimationScaleBounce() ModalAnimation
func NewModalAnimationUp ¶
func NewModalAnimationUp() ModalAnimation
type ModalColors ¶
type ModalStyle ¶
type ModalStyle struct { CloseOnOutsideClick bool KeepClickableArea bool CloseOnInsideClick bool Direction layout.Direction Inset layout.Inset Rounded Rounded Animation ModalAnimation Colors ModalColors }
type NotificationColors ¶
type NotificationModal ¶
type NotificationModal struct { Style NotificationStyle Modal *Modal // contains filtered or unexported fields }
func NewNotificationModal ¶
func NewNotificationModal(window *app.Window, style NotificationStyle) *NotificationModal
func (*NotificationModal) Layout ¶
func (n *NotificationModal) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
func (*NotificationModal) SetText ¶
func (n *NotificationModal) SetText(title string, text string)
func (*NotificationModal) SetVisible ¶
func (n *NotificationModal) SetVisible(visible bool, closeAfter time.Duration)
type NotificationStyle ¶
type ProgressBar ¶
func (ProgressBar) Layout ¶
func (p ProgressBar) Layout(gtx layout.Context) layout.Dimensions
type ProgressBarColors ¶
type Rounded ¶
func UniformRounded ¶
type TabBars ¶
type TabBars struct { Key string Items []*TabBarsItem Colors TabBarsColors // contains filtered or unexported fields }
func NewTabBars ¶
func NewTabBars(defaultKey string, items []*TabBarsItem) *TabBars
type TabBarsColors ¶
type TabBarsItem ¶
type TabBarsItem struct { Key string // contains filtered or unexported fields }
func NewTabBarItem ¶
func NewTabBarItem(key string) *TabBarsItem
Click to show internal directories.
Click to hide internal directories.