Button setIcon: Allow keep button width (#7546)

Useful when said Button was instantiated with a custom width, as is the case in SortWidget.
pull/7553/head
hius07 3 years ago committed by GitHub
parent ea3fa5c2c7
commit 7092df7f4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -161,10 +161,10 @@ function Button:setText(text, width)
end end
end end
function Button:setIcon(icon) function Button:setIcon(icon, width)
if icon ~= self.icon then if icon ~= self.icon then
self.icon = icon self.icon = icon
self.width = nil self.width = width
self:init() self:init()
end end
end end

Loading…
Cancel
Save