Fix issue #73
This commit is contained in:
parent
ac8d6891ca
commit
d1d8b79edc
|
@ -166,14 +166,7 @@ function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
|||
self.movedIndex = nil
|
||||
end
|
||||
|
||||
local parent = self:getParent()
|
||||
if parent then
|
||||
if parent:getClassName() == 'UIMiniWindowContainer' then
|
||||
parent:saveChildren()
|
||||
else
|
||||
self:saveParentPosition(parent:getId(), self:getPosition())
|
||||
end
|
||||
end
|
||||
self:saveParent(self:getParent())
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragMove(mousePos, mouseMoved)
|
||||
|
@ -267,6 +260,17 @@ function UIMiniWindow:setSettings(data)
|
|||
g_settings.setNode('MiniWindows', settings)
|
||||
end
|
||||
|
||||
function UIMiniWindow:saveParent(parent)
|
||||
local parent = self:getParent()
|
||||
if parent then
|
||||
if parent:getClassName() == 'UIMiniWindowContainer' then
|
||||
parent:saveChildren()
|
||||
else
|
||||
self:saveParentPosition(parent:getId(), self:getPosition())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UIMiniWindow:saveParentPosition(parentId, position)
|
||||
local selfSettings = {}
|
||||
selfSettings.parentId = parentId
|
||||
|
@ -286,6 +290,12 @@ function UIMiniWindow:disableResize()
|
|||
self:getChildById('bottomResizeBorder'):disable()
|
||||
end
|
||||
|
||||
function UIMiniWindow:setContentHeight(height)
|
||||
local contentsPanel = self:getChildById('contentsPanel')
|
||||
local minHeight = contentsPanel:getMarginTop() + contentsPanel:getMarginBottom() + contentsPanel:getPaddingTop() + contentsPanel:getPaddingBottom()
|
||||
self:setHeight(minHeight + height)
|
||||
end
|
||||
|
||||
function UIMiniWindow:setContentMinimumHeight(height)
|
||||
local contentsPanel = self:getChildById('contentsPanel')
|
||||
local minHeight = contentsPanel:getMarginTop() + contentsPanel:getMarginBottom() + contentsPanel:getPaddingTop() + contentsPanel:getPaddingBottom()
|
||||
|
|
|
@ -93,6 +93,7 @@ function onContainerOpen(container, previousContainer)
|
|||
local cellSize = layout:getCellSize()
|
||||
containerWindow:setContentMinimumHeight(cellSize.height*1)
|
||||
containerWindow:setContentMaximumHeight(cellSize.height*layout:getNumLines())
|
||||
containerWindow:setContentHeight(3*cellSize.height/2)
|
||||
end
|
||||
|
||||
function onContainerClose(container)
|
||||
|
|
|
@ -486,6 +486,7 @@ function onLeftPanelVisibilityChange(leftPanel, visible)
|
|||
local children = leftPanel:getChildren()
|
||||
for i=1,#children do
|
||||
children[i]:setParent(gameRightPanel)
|
||||
children[i]:saveParent(gameRightPanel)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -587,7 +587,7 @@ void Map::saveOtcm(const std::string& fileName)
|
|||
fin->flush();
|
||||
|
||||
fin->close();
|
||||
g_logger.debug(stdext::format("Otcm save time: %.2f seconds", saveTimer.elapsed_seconds()));
|
||||
//g_logger.debug(stdext::format("Otcm save time: %.2f seconds", saveTimer.elapsed_seconds()));
|
||||
} catch(stdext::exception& e) {
|
||||
g_logger.error(stdext::format("failed to save OTCM map: %s", e.what()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue