Button setIcon: Allow keep button width (#7546)

Useful when said Button was instantiated with a custom width, as is the case in SortWidget.
This commit is contained in:
hius07 authored and GitHub committed 2021-04-16 01:35:04 +02:00
1 parent ea3fa5c2c7
commit 7092df7f4e
1 file changed
+2 -2
+2 -2
View File
@@ -161,10 +161,10 @@ function Button:setText(text, width)
end
end
function Button:setIcon(icon)
function Button:setIcon(icon, width)
if icon ~= self.icon then
self.icon = icon
self.width = nil
self.width = width
self:init()
end
end