mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
auto resize menu width
This commit is contained in:
@@ -23,6 +23,8 @@ function UIPopupMenu:addOption(optionName, optionCallback)
|
||||
self:destroy()
|
||||
end
|
||||
optionWidget:setText(optionName)
|
||||
local width = optionWidget:getTextSize().width + optionWidget:getMarginLeft() + optionWidget:getMarginRight() + 6
|
||||
self:setWidth(math.max(self:getWidth(), width))
|
||||
end
|
||||
|
||||
function UIPopupMenu:addSeparator()
|
||||
|
Reference in New Issue
Block a user