Tweaked some sizing

This commit is contained in:
Sasha Koshka 2023-08-21 00:01:34 -04:00
parent 2bd5a4a66b
commit ae069b019e
1 changed files with 9 additions and 4 deletions

View File

@ -82,9 +82,8 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
gapBorder,
buttonBorder,
}
padding := tomo.I(4, 8)
box.SetColor(buttonColor)
box.SetPadding(tomo.I(4, 8))
if box.Focused() {
box.SetColor(buttonColorFocused)
@ -92,12 +91,13 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
}
if pressed {
box.SetColor(buttonColorPressed)
padding = tomo.I(5, 8, 4, 9)
border[2] = sunkenShadow
box.SetPadding(tomo.I(5, 8, 4, 9))
} else if hovered {
box.SetColor(buttonColorHovered)
}
box.SetBorder(border...)
box.SetPadding(padding)
}
updateStyle()
return event.MultiCookie (
@ -155,11 +155,16 @@ func (Theme) Apply (object tomo.Object, role theme.Role) event.Cookie {
case "Separator":
box.SetBorder(engravedBorder)
box.SetMinimumSize(image.Pt(2, 2))
case "Slider":
pressed := false
hovered := false
if role.Variant == "vertical" {
box.SetMinimumSize(image.Pt(0, 48))
} else {
box.SetMinimumSize(image.Pt(48, 0))
}
updateStyle := func () {
border := []tomo.Border {