Bot file name update, saving height for containers

This commit is contained in:
OTCv8 2020-11-20 14:15:44 +01:00
parent 407553647d
commit 8fa45f387d
3 changed files with 3 additions and 2 deletions

View File

@ -184,7 +184,7 @@ function UIMiniWindow:setup()
self.miniLoaded = true self.miniLoaded = true
if self.save then if self.save then
if oldParent and oldParent:getClassName() == 'UIMiniWindowContainer' and not self.containerWindow then if oldParent and oldParent:getClassName() == 'UIMiniWindowContainer' then
addEvent(function() oldParent:order() end) addEvent(function() oldParent:order() end)
end end
if newParent and newParent:getClassName() == 'UIMiniWindowContainer' and newParent ~= oldParent then if newParent and newParent:getClassName() == 'UIMiniWindowContainer' and newParent ~= oldParent then

View File

@ -167,7 +167,8 @@ function onContainerOpen(container, previousContainer)
containerWindow:setContentMinimumHeight(cellSize.height) containerWindow:setContentMinimumHeight(cellSize.height)
containerWindow:setContentMaximumHeight(cellSize.height*layout:getNumLines()) containerWindow:setContentMaximumHeight(cellSize.height*layout:getNumLines())
if not previousContainer then local hasHeightInSettings = containerWindow:getSettings("height")
if not previousContainer and not hasHeightInSettings then
local filledLines = math.max(math.ceil(container:getItemsCount() / layout:getNumColumns()), 1) local filledLines = math.max(math.ceil(container:getItemsCount() / layout:getNumColumns()), 1)
containerWindow:setContentHeight(filledLines*cellSize.height) containerWindow:setContentHeight(filledLines*cellSize.height)
end end