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,
|
||||
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,12 +155,17 @@ 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 {
|
||||
engravedBorder,
|
||||
|
Reference in New Issue
Block a user