Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StdButton is the theme all new Buttons get by default. StdButton = NewTheme() )
Functions ¶
This section is empty.
Types ¶
type BaseTextTheme ¶
type BaseTextTheme struct { BaseTheme TextWhenLight color.Color // The text color to use when the background is considered to be 'light'. TextWhenDark color.Color // The text color to use when the background is considered to be 'dark'. TextWhenDisabled color.Color // The text color to use when disabled. Font *font.Font // The font to use. }
BaseTextTheme contains the common theme elements used in all buttons that display text.
func (*BaseTextTheme) Init ¶
func (theme *BaseTextTheme) Init()
Init initializes the theme with its default values.
type BaseTheme ¶
type BaseTheme struct { ClickAnimationTime time.Duration // The amount of time to spend animating the click action. CornerRadius float64 // The amount of rounding to use on the corners. Background color.Color // The background color when enabled but not pressed or focused. BackgroundWhenPressed color.Color // The background color when enabled and pressed. GradientAdjustment float64 // The amount to vary the color when creating the background gradient. DisabledAdjustment float64 // The amount to adjust the background brightness when disabled. OutlineAdjustment float64 // The amount to adjust the background brightness when using it to draw the button outline. }
BaseTheme contains the common theme elements used in all buttons.
type Button ¶
type Button struct { widget.Block Theme *Theme // The theme the button will use to draw itself. Title string // The title of the button. // contains filtered or unexported fields }
Button represents a clickable text button.
func (*Button) BaseBackground ¶
BaseBackground returns this button's current base background color.
func (*Button) Click ¶
func (button *Button) Click()
Click makes the button behave as if a user clicked on it.
type Theme ¶
type Theme struct { BaseTextTheme HorizontalMargin float64 // The margin on the left and right side of the text. VerticalMargin float64 // The margin on the top and bottom of the text. MinimumTextWidth float64 // The minimum space to permit for text. }
Theme contains the theme elements for Buttons.
Click to show internal directories.
Click to hide internal directories.