Documentation
¶
Index ¶
- type C
- type D
- type LabelAlignment
- type LabelOption
- type ModalLayer
- type TextField
- func (in *TextField) Changed() bool
- func (in *TextField) Clear()
- func (in *TextField) ClearError()
- func (in *TextField) Focused(gtx layout.Context) bool
- func (in *TextField) Layout(gtx layout.Context, th *theme.Theme, hint string) layout.Dimensions
- func (in *TextField) SetError(err string)
- func (in *TextField) SetText(text string)
- func (in *TextField) Submitted() bool
- func (in *TextField) Text() string
- type WrapList
- type WrapListStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type D ¶
type D = layout.Dimensions
type LabelAlignment ¶
type LabelAlignment uint8
const ( Top LabelAlignment = iota Left Right Hidden )
type LabelOption ¶
type LabelOption struct {
Alignment LabelAlignment
Ratio float32
// Space between laben and input box
Padding unit.Dp
}
type ModalLayer ¶ added in v0.5.0
type ModalLayer struct {
component.VisibilityAnimation
Widget func(gtx layout.Context, th *material.Theme, anim *component.VisibilityAnimation) layout.Dimensions
}
ModalLayer is a widget drawn on top of the normal UI that can be populated by other components with dismissble modal dialogs.
func NewModal ¶ added in v0.5.0
func NewModal() *ModalLayer
NewModal creates an initializes a modal layer.
func (*ModalLayer) Layout ¶ added in v0.5.0
func (m *ModalLayer) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
Layout renders the modal layer. Unless a modal widget has been triggered, this will do nothing.
type TextField ¶
type TextField struct {
// padding between the text and border.
Padding unit.Dp
// border radius of the input box.
Radius unit.Dp
SingleLine bool
// Text alignment in the box.
Alignment text.Alignment
// Label alignment option
LabelOption LabelOption
// Helper text to give additional context to a field.
HelperText string
// The maximum number of characters the text input will allow.
// Zero means no limit.
MaxChars int
// Mask replaces the visual display of each rune in the contents with the given rune.
Mask rune
// Leading appears before the content of the text input.
Leading layout.Widget
// Trailing appears after the content of the text input.
Trailing layout.Widget
// contains filtered or unexported fields
}
Another TextField implementation with the following features: * configurable padding and border radius * more compact design by put character counters inline. * subscribe ESC key events to defocus the text field. * configurable label alignment.
func (*TextField) Changed ¶
Changed returns whether or not the text input has changed since last call.
func (*TextField) ClearError ¶
func (in *TextField) ClearError()
type WrapList ¶
WrapList holds the persistent state for a wrappable layout.List that has a scrollbar attached.
type WrapListStyle ¶
type WrapListStyle struct {
material.ScrollbarStyle
material.AnchorStrategy
// contains filtered or unexported fields
}
WrapListStyle configures the presentation of a wrappable layout.List with a scrollbar.
func (WrapListStyle) Layout ¶
func (l WrapListStyle) Layout(gtx layout.Context, length int, w layout.ListElement) layout.Dimensions
Layout the list and its scrollbar.