@ -44,7 +44,7 @@ local Button = InputContainer:new{
margin = 0 ,
margin = 0 ,
bordersize = Size.border . button ,
bordersize = Size.border . button ,
background = Blitbuffer.COLOR_WHITE ,
background = Blitbuffer.COLOR_WHITE ,
radius = Size.radius . button ,
radius = nil ,
padding = Size.padding . button ,
padding = Size.padding . button ,
padding_h = nil ,
padding_h = nil ,
padding_v = nil ,
padding_v = nil ,
@ -233,6 +233,11 @@ function Button:onTapSelectButton()
-- c.f., #4554 & #4541
-- c.f., #4554 & #4541
-- NOTE: self[1] -> self.frame, if you're confused about what this does vs. onFocus/onUnfocus ;).
-- NOTE: self[1] -> self.frame, if you're confused about what this does vs. onFocus/onUnfocus ;).
if self.text then
if self.text then
-- We only want the button's *highlight* to have rounded corners (otherwise they're redundant, same color as the bg).
-- The nil check is to discriminate the default from callers that explicitly request a specific radius.
if self [ 1 ] . radius == nil then
self [ 1 ] . radius = Size.radius . button
end
UIManager : widgetRepaint ( self [ 1 ] , self [ 1 ] . dimen.x , self [ 1 ] . dimen.y )
UIManager : widgetRepaint ( self [ 1 ] , self [ 1 ] . dimen.x , self [ 1 ] . dimen.y )
end
end
UIManager : setDirty ( nil , function ( )
UIManager : setDirty ( nil , function ( )
@ -245,11 +250,13 @@ function Button:onTapSelectButton()
-- widget no more there (destroyed, re-init'ed by setText(), or not inverted: nothing to invert back
-- widget no more there (destroyed, re-init'ed by setText(), or not inverted: nothing to invert back
return
return
end
end
self [ 1 ] . invert = false
self [ 1 ] . invert = false
UIManager : widgetRepaint ( self [ 1 ] , self [ 1 ] . dimen.x , self [ 1 ] . dimen.y )
-- Since we kill the corners, we only need a single repaint.
if self .text then
if self [ 1 ] . radius == Size.radius . button then
UIManager: widgetRepaint ( self [ 1 ] , self [ 1 ] . dimen.x , self [ 1 ] . dimen.y )
self[ 1 ] . radius = nil
end
end
UIManager : widgetRepaint ( self [ 1 ] , self [ 1 ] . dimen.x , self [ 1 ] . dimen.y )
UIManager : setDirty ( nil , function ( )
UIManager : setDirty ( nil , function ( )
return " fast " , self [ 1 ] . dimen
return " fast " , self [ 1 ] . dimen
end )
end )