TileLayout: fix a layout bug in "static" mode

This commit is contained in:
Olivier Teulière 2012-01-28 01:04:35 +01:00
parent 51d6a3bc8b
commit 6411b1975d

View file

@ -92,6 +92,9 @@ void TileLayout::setGeometry(const QRect &rect)
void TileLayout::doLayout(const QRect &rect)
{
if (m_items.isEmpty())
return;
const int width = rect.width() + m_space;
const int height = rect.height() + m_space;
if (m_dynamic)
@ -129,6 +132,10 @@ void TileLayout::doLayout(const QRect &rect)
m_nbRows = (tilesCount - 1) / m_nbCols + 1;
}
}
else
{
m_nbRows = (m_items.size() - 1) / m_nbCols + 1;
}
if (m_nbCols == 0)
return;