diff --git a/frontend/ui/widget/button.lua b/frontend/ui/widget/button.lua index 974a384e7..b584dd052 100644 --- a/frontend/ui/widget/button.lua +++ b/frontend/ui/widget/button.lua @@ -44,7 +44,7 @@ local Button = InputContainer:new{ margin = 0, bordersize = Size.border.button, background = Blitbuffer.COLOR_WHITE, - radius = Size.radius.button, + radius = nil, padding = Size.padding.button, padding_h = nil, padding_v = nil, @@ -233,6 +233,11 @@ function Button:onTapSelectButton() -- c.f., #4554 & #4541 -- NOTE: self[1] -> self.frame, if you're confused about what this does vs. onFocus/onUnfocus ;). 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) end 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 return end + self[1].invert = false - UIManager:widgetRepaint(self[1], self[1].dimen.x, self[1].dimen.y) - if self.text then - 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[1].radius == Size.radius.button then + self[1].radius = nil end + UIManager:widgetRepaint(self[1], self[1].dimen.x, self[1].dimen.y) UIManager:setDirty(nil, function() return "fast", self[1].dimen end) diff --git a/frontend/ui/widget/container/framecontainer.lua b/frontend/ui/widget/container/framecontainer.lua index cc5ecad1d..cb1a04fc5 100644 --- a/frontend/ui/widget/container/framecontainer.lua +++ b/frontend/ui/widget/container/framecontainer.lua @@ -28,7 +28,7 @@ local FrameContainer = WidgetContainer:new{ background = nil, color = Blitbuffer.COLOR_BLACK, margin = 0, - radius = 0, + radius = nil, inner_bordersize = 0, bordersize = Size.border.window, padding = Size.padding.default,