From 7092df7f4e09f595239afee0706ce20609abefd1 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Fri, 16 Apr 2021 02:35:04 +0300 Subject: [PATCH] Button setIcon: Allow keep button width (#7546) Useful when said Button was instantiated with a custom width, as is the case in SortWidget. --- frontend/ui/widget/button.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/ui/widget/button.lua b/frontend/ui/widget/button.lua index 4a862d915..ad29168bb 100644 --- a/frontend/ui/widget/button.lua +++ b/frontend/ui/widget/button.lua @@ -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