Tweaked some sizing
This commit is contained in:
parent
2bd5a4a66b
commit
ae069b019e
13
theme.go
13
theme.go
@ -82,9 +82,8 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
|
|||||||
gapBorder,
|
gapBorder,
|
||||||
buttonBorder,
|
buttonBorder,
|
||||||
}
|
}
|
||||||
|
padding := tomo.I(4, 8)
|
||||||
box.SetColor(buttonColor)
|
box.SetColor(buttonColor)
|
||||||
box.SetPadding(tomo.I(4, 8))
|
|
||||||
|
|
||||||
if box.Focused() {
|
if box.Focused() {
|
||||||
box.SetColor(buttonColorFocused)
|
box.SetColor(buttonColorFocused)
|
||||||
@ -92,12 +91,13 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
|
|||||||
}
|
}
|
||||||
if pressed {
|
if pressed {
|
||||||
box.SetColor(buttonColorPressed)
|
box.SetColor(buttonColorPressed)
|
||||||
|
padding = tomo.I(5, 8, 4, 9)
|
||||||
border[2] = sunkenShadow
|
border[2] = sunkenShadow
|
||||||
box.SetPadding(tomo.I(5, 8, 4, 9))
|
|
||||||
} else if hovered {
|
} else if hovered {
|
||||||
box.SetColor(buttonColorHovered)
|
box.SetColor(buttonColorHovered)
|
||||||
}
|
}
|
||||||
box.SetBorder(border...)
|
box.SetBorder(border...)
|
||||||
|
box.SetPadding(padding)
|
||||||
}
|
}
|
||||||
updateStyle()
|
updateStyle()
|
||||||
return event.MultiCookie (
|
return event.MultiCookie (
|
||||||
@ -155,11 +155,16 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
|
|||||||
|
|
||||||
case "Separator":
|
case "Separator":
|
||||||
box.SetBorder(engravedBorder)
|
box.SetBorder(engravedBorder)
|
||||||
box.SetMinimumSize(image.Pt(2, 2))
|
|
||||||
|
|
||||||
case "Slider":
|
case "Slider":
|
||||||
pressed := false
|
pressed := false
|
||||||
hovered := false
|
hovered := false
|
||||||
|
|
||||||
|
if role.Variant == "vertical" {
|
||||||
|
box.SetMinimumSize(image.Pt(0, 48))
|
||||||
|
} else {
|
||||||
|
box.SetMinimumSize(image.Pt(48, 0))
|
||||||
|
}
|
||||||
|
|
||||||
updateStyle := func () {
|
updateStyle := func () {
|
||||||
border := []tomo.Border {
|
border := []tomo.Border {
|
||||||
|
Reference in New Issue
Block a user