mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user