Documentation
¶
Index ¶
- Constants
- Variables
- func EqualButtonColors(a, b *ButtonColors) bool
- func EqualButtonElevation(a, b *ButtonElevation) bool
- func EqualButtonShapes(a, b *ButtonShapes) bool
- func IsSpecifiedButtonColors(c *ButtonColors) bool
- func IsSpecifiedButtonElevation(e *ButtonElevation) bool
- func IsSpecifiedButtonShapes(s *ButtonShapes) bool
- func SameButtonColors(a, b *ButtonColors) bool
- func SameButtonElevation(a, b *ButtonElevation) bool
- func SameButtonShapes(a, b *ButtonShapes) bool
- func SemanticEqualButtonColors(a, b *ButtonColors) bool
- func SemanticEqualButtonElevation(a, b *ButtonElevation) bool
- func SemanticEqualButtonShapes(a, b *ButtonShapes) bool
- func StringButtonColors(c *ButtonColors) string
- func StringButtonElevation(e *ButtonElevation) string
- func StringButtonShapes(s *ButtonShapes) string
- type ButtonColors
- type ButtonColorsOption
- type ButtonElevation
- func CoalesceButtonElevation(ptr, def *ButtonElevation) *ButtonElevation
- func CopyButtonElevation(e *ButtonElevation, options ...ButtonElevationOption) *ButtonElevation
- func MergeButtonElevation(a, b *ButtonElevation) *ButtonElevation
- func TakeOrElseButtonElevation(e, defaultElevation *ButtonElevation) *ButtonElevation
- type ButtonElevationOption
- type ButtonOption
- func WithBorder(b *foundation.BorderStroke) ButtonOption
- func WithButton(button *button.Button) ButtonOption
- func WithColors(c *ButtonColors) ButtonOption
- func WithContentPadding(p layout.PaddingValues) ButtonOption
- func WithElevation(e *ButtonElevation) ButtonOption
- func WithEnabled(enabled bool) ButtonOption
- func WithModifier(m Modifier) ButtonOption
- func WithShape(s shape.Shape) ButtonOption
- func WithShapes(s *ButtonShapes) ButtonOption
- type ButtonOptions
- type ButtonShapes
- type ButtonShapesOption
- type Composable
- type Composer
- type Modifier
- type MutableValue
- type ThemeManager
Constants ¶
const Material3ButtonNodeID = "Material3Button"
Variables ¶
var ButtonColorsUnspecified = &ButtonColors{ ContainerColor: graphics.ColorUnspecified, ContentColor: graphics.ColorUnspecified, DisabledContainerColor: graphics.ColorUnspecified, DisabledContentColor: graphics.ColorUnspecified, }
var ButtonDefaults = buttonDefaults{}
var ButtonElevationUnspecified = &ButtonElevation{ DefaultElevation: unit.DpUnspecified, PressedElevation: unit.DpUnspecified, FocusedElevation: unit.DpUnspecified, HoveredElevation: unit.DpUnspecified, DisabledElevation: unit.DpUnspecified, }
ButtonElevationUnspecified is the sentinel value for unspecified ButtonElevation
var ButtonShapesUnspecified = &ButtonShapes{ Shape: shape.ShapeUnspecified, PressedShape: shape.ShapeUnspecified, }
ButtonShapesUnspecified is the sentinel value for unspecified ButtonShapes
var EmptyModifier = modifier.EmptyModifier
Functions ¶
func EqualButtonColors ¶
func EqualButtonColors(a, b *ButtonColors) bool
EqualButtonColors returns true if a and b are semantically equal
func EqualButtonElevation ¶
func EqualButtonElevation(a, b *ButtonElevation) bool
EqualButtonElevation returns true if a and b are semantically equal
func EqualButtonShapes ¶
func EqualButtonShapes(a, b *ButtonShapes) bool
EqualButtonShapes returns true if a and b are semantically equal
func IsSpecifiedButtonColors ¶
func IsSpecifiedButtonColors(c *ButtonColors) bool
func IsSpecifiedButtonElevation ¶
func IsSpecifiedButtonElevation(e *ButtonElevation) bool
IsSpecifiedButtonElevation returns true if e is specified (not nil and not the sentinel)
func IsSpecifiedButtonShapes ¶
func IsSpecifiedButtonShapes(s *ButtonShapes) bool
IsSpecifiedButtonShapes returns true if s is specified (not nil and not the sentinel)
func SameButtonColors ¶
func SameButtonColors(a, b *ButtonColors) bool
SameButtonColors returns true if a and b are the same pointer or both unspecified
func SameButtonElevation ¶
func SameButtonElevation(a, b *ButtonElevation) bool
SameButtonElevation returns true if a and b are the same pointer or both unspecified
func SameButtonShapes ¶
func SameButtonShapes(a, b *ButtonShapes) bool
SameButtonShapes returns true if a and b are the same pointer or both unspecified
func SemanticEqualButtonColors ¶
func SemanticEqualButtonColors(a, b *ButtonColors) bool
SemanticEqualButtonColors checks field-by-field equality
func SemanticEqualButtonElevation ¶
func SemanticEqualButtonElevation(a, b *ButtonElevation) bool
SemanticEqualButtonElevation checks field-by-field equality
func SemanticEqualButtonShapes ¶
func SemanticEqualButtonShapes(a, b *ButtonShapes) bool
SemanticEqualButtonShapes checks field-by-field equality
func StringButtonColors ¶
func StringButtonColors(c *ButtonColors) string
StringButtonColors returns a string representation of ButtonColors
func StringButtonElevation ¶
func StringButtonElevation(e *ButtonElevation) string
StringButtonElevation returns a string representation of ButtonElevation
func StringButtonShapes ¶
func StringButtonShapes(s *ButtonShapes) string
StringButtonShapes returns a string representation of ButtonShapes
Types ¶
type ButtonColors ¶
type ButtonColors struct {
ContainerColor graphics.Color
ContentColor graphics.Color
DisabledContainerColor graphics.Color
DisabledContentColor graphics.Color
}
func CoalesceButtonColors ¶
func CoalesceButtonColors(ptr, def *ButtonColors) *ButtonColors
CoalesceButtonColors returns ptr if not nil, otherwise returns def
func CopyButtonColors ¶
func CopyButtonColors(c *ButtonColors, options ...ButtonColorsOption) *ButtonColors
CopyButtonColors creates a copy with optional modifications
func MergeButtonColors ¶
func MergeButtonColors(a, b *ButtonColors) *ButtonColors
MergeButtonColors merges two ButtonColors, preferring b's specified values over a's
func TakeOrElseButtonColors ¶
func TakeOrElseButtonColors(c, defaultColors *ButtonColors) *ButtonColors
TakeOrElseButtonColors returns c if specified, otherwise returns defaultColors
type ButtonColorsOption ¶
type ButtonColorsOption func(*ButtonColors)
ButtonColorsOption is a functional option for CopyButtonColors
func WithButtonContainerColor ¶
func WithButtonContainerColor(c graphics.Color) ButtonColorsOption
WithButtonContainerColor sets the container color option
func WithButtonContentColor ¶
func WithButtonContentColor(c graphics.Color) ButtonColorsOption
WithButtonContentColor sets the content color option
func WithButtonDisabledContainerColor ¶
func WithButtonDisabledContainerColor(c graphics.Color) ButtonColorsOption
WithButtonDisabledContainerColor sets the disabled container color option
func WithButtonDisabledContentColor ¶
func WithButtonDisabledContentColor(c graphics.Color) ButtonColorsOption
WithButtonDisabledContentColor sets the disabled content color option
type ButtonElevation ¶
type ButtonElevation struct {
DefaultElevation unit.Dp
PressedElevation unit.Dp
FocusedElevation unit.Dp
HoveredElevation unit.Dp
DisabledElevation unit.Dp
}
ButtonElevation holds elevation configuration for button states
func CoalesceButtonElevation ¶
func CoalesceButtonElevation(ptr, def *ButtonElevation) *ButtonElevation
CoalesceButtonElevation returns ptr if not nil, otherwise returns def
func CopyButtonElevation ¶
func CopyButtonElevation(e *ButtonElevation, options ...ButtonElevationOption) *ButtonElevation
CopyButtonElevation creates a copy with optional modifications
func MergeButtonElevation ¶
func MergeButtonElevation(a, b *ButtonElevation) *ButtonElevation
MergeButtonElevation merges two ButtonElevation, preferring b's specified values over a's
func TakeOrElseButtonElevation ¶
func TakeOrElseButtonElevation(e, defaultElevation *ButtonElevation) *ButtonElevation
TakeOrElseButtonElevation returns e if specified, otherwise returns defaultElevation
type ButtonElevationOption ¶
type ButtonElevationOption func(*ButtonElevation)
ButtonElevationOption is a functional option for CopyButtonElevation
func WithDefaultElevation ¶
func WithDefaultElevation(e unit.Dp) ButtonElevationOption
WithDefaultElevation sets the default elevation option
func WithDisabledElevation ¶
func WithDisabledElevation(e unit.Dp) ButtonElevationOption
WithDisabledElevation sets the disabled elevation option
func WithFocusedElevation ¶
func WithFocusedElevation(e unit.Dp) ButtonElevationOption
WithFocusedElevation sets the focused elevation option
func WithHoveredElevation ¶
func WithHoveredElevation(e unit.Dp) ButtonElevationOption
WithHoveredElevation sets the hovered elevation option
func WithPressedElevation ¶
func WithPressedElevation(e unit.Dp) ButtonElevationOption
WithPressedElevation sets the pressed elevation option
type ButtonOption ¶
type ButtonOption func(o *ButtonOptions)
func WithBorder ¶
func WithBorder(b *foundation.BorderStroke) ButtonOption
func WithButton ¶
func WithButton(button *button.Button) ButtonOption
func WithColors ¶
func WithColors(c *ButtonColors) ButtonOption
func WithContentPadding ¶
func WithContentPadding(p layout.PaddingValues) ButtonOption
func WithElevation ¶
func WithElevation(e *ButtonElevation) ButtonOption
func WithEnabled ¶
func WithEnabled(enabled bool) ButtonOption
func WithModifier ¶
func WithModifier(m Modifier) ButtonOption
func WithShape ¶
func WithShape(s shape.Shape) ButtonOption
func WithShapes ¶
func WithShapes(s *ButtonShapes) ButtonOption
type ButtonOptions ¶
type ButtonOptions struct {
Modifier Modifier
Button *button.Button
Enabled bool
Shape shape.Shape // Single shape (legacy/simple API)
Shapes *ButtonShapes // Shape and PressedShape for expressive shape morphing
Colors *ButtonColors
Elevation *ButtonElevation
Border *foundation.BorderStroke
ContentPadding layout.PaddingValues
}
func DefaultButtonOptions ¶
func DefaultButtonOptions() ButtonOptions
type ButtonShapes ¶
ButtonShapes holds shape configuration for button states
func CoalesceButtonShapes ¶
func CoalesceButtonShapes(ptr, def *ButtonShapes) *ButtonShapes
CoalesceButtonShapes returns ptr if not nil, otherwise returns def
func CopyButtonShapes ¶
func CopyButtonShapes(s *ButtonShapes, options ...ButtonShapesOption) *ButtonShapes
CopyButtonShapes creates a copy with optional modifications
func MergeButtonShapes ¶
func MergeButtonShapes(a, b *ButtonShapes) *ButtonShapes
MergeButtonShapes merges two ButtonShapes, preferring b's specified values over a's
func TakeOrElseButtonShapes ¶
func TakeOrElseButtonShapes(s, defaultShapes *ButtonShapes) *ButtonShapes
TakeOrElseButtonShapes returns s if specified, otherwise returns defaultShapes
type ButtonShapesOption ¶
type ButtonShapesOption func(*ButtonShapes)
ButtonShapesOption is a functional option for CopyButtonShapes
func WithButtonPressedShape ¶
func WithButtonPressedShape(s shape.Shape) ButtonShapesOption
WithButtonPressedShape sets the pressed shape option
func WithButtonShape ¶
func WithButtonShape(s shape.Shape) ButtonShapesOption
WithButtonShape sets the shape option
type Composable ¶
type Composable = api.Composable
func Outlined ¶
func Outlined(onClick func(), label string, options ...ButtonOption) Composable
func OutlinedButton ¶
func OutlinedButton(onClick func(), content Composable, options ...ButtonOption) Composable
type MutableValue ¶
type MutableValue = state.MutableValue
type ThemeManager ¶
type ThemeManager = theme.ThemeManager