KalugaButtonStyle

data class KalugaButtonStyle(val font: KalugaFont, val textSize: Float, val textAlignment: KalugaTextAlignment = KalugaTextAlignment.CENTER, val defaultStyle: ButtonStateStyle, val pressedStyle: ButtonStateStyle = defaultStyle, val disabledStyle: ButtonStateStyle = defaultStyle)

The style to apply to a button

Constructors

Link copied to clipboard
constructor(textStyle: KalugaTextStyle, textAlignment: KalugaTextAlignment = KalugaTextAlignment.CENTER, backgroundColor: KalugaColor = DefaultColors.clear, pressedBackgroundColor: KalugaColor = backgroundColor, disabledBackgroundColor: KalugaColor = backgroundColor, shape: KalugaBackgroundStyle.Shape = KalugaBackgroundStyle.Shape.Rectangle())

Constructor

constructor(font: KalugaFont, textSize: Float, textAlignment: KalugaTextAlignment = KalugaTextAlignment.CENTER, defaultStyle: ButtonStateStyle, pressedStyle: ButtonStateStyle = defaultStyle, disabledStyle: ButtonStateStyle = defaultStyle)

Properties

Link copied to clipboard

the ButtonStateStyle when the button is not in a special state

Link copied to clipboard

the ButtonStateStyle when the button is disabled

Link copied to clipboard

the KalugaFont of the button text

Link copied to clipboard

the ButtonStateStyle when the button is pressed

Link copied to clipboard

the KalugaTextAlignment of the text of the button

Link copied to clipboard

the size of the button text in points

Functions

Link copied to clipboard
fun getStateStyle(isEnabled: Boolean, isPressed: Boolean): ButtonStateStyle

Gets the ButtonStateStyle of the button depending on the state

Link copied to clipboard
fun getStateTextStyle(isEnabled: Boolean, isPressed: Boolean): KalugaTextStyle

Gets the KalugaTextStyle of the button depending on the state