go fmt on togglebutton.go
This commit is contained in:
parent
4f047b24de
commit
97c0449bbd
1 changed files with 3 additions and 3 deletions
|
@ -8,8 +8,8 @@ type togglebuttonColoring struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// togglebuttonColors lists the styling for each supported state.
|
// togglebuttonColors lists the styling for each supported state.
|
||||||
var togglebuttonColors = map[ControlState]togglebuttonColoring {
|
var togglebuttonColors = map[ControlState]togglebuttonColoring{
|
||||||
Normal: {ToggleDefaultBorderColor, ToggleDefaultInsideColor, ToggleDefaultTextColor},
|
Normal: {ToggleDefaultBorderColor, ToggleDefaultInsideColor, ToggleDefaultTextColor},
|
||||||
// Hijacking 'Clicked' for the 'active' state.
|
// Hijacking 'Clicked' for the 'active' state.
|
||||||
Clicked: {ToggleActiveBorderColor, ToggleActiveInsideColor, ToggleDefaultTextColor},
|
Clicked: {ToggleActiveBorderColor, ToggleActiveInsideColor, ToggleDefaultTextColor},
|
||||||
Pressed: {TogglePressedBorderColor, TogglePressedInsideColor, TogglePressedTextColor},
|
Pressed: {TogglePressedBorderColor, TogglePressedInsideColor, TogglePressedTextColor},
|
||||||
|
@ -21,7 +21,7 @@ func ToggleButton(bounds rl.Rectangle, text string, active bool) bool {
|
||||||
textHeight := int32(style[GlobalTextFontsize])
|
textHeight := int32(style[GlobalTextFontsize])
|
||||||
textWidth := rl.MeasureText(text, textHeight)
|
textWidth := rl.MeasureText(text, textHeight)
|
||||||
|
|
||||||
ConstrainRectangle(&bounds, textWidth, textWidth + GetStyle32(ToggleTextPadding), textHeight, textHeight + GetStyle32(ToggleTextPadding))
|
ConstrainRectangle(&bounds, textWidth, textWidth+GetStyle32(ToggleTextPadding), textHeight, textHeight+GetStyle32(ToggleTextPadding))
|
||||||
|
|
||||||
state := GetInteractionState(bounds)
|
state := GetInteractionState(bounds)
|
||||||
if state == Clicked {
|
if state == Clicked {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue