1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-26 04:43:06 +01:00

* Fixed auto-resizing of GridViews for when we have exactly one row.

This commit is contained in:
Christian Muehlhaeuser 2013-09-01 17:00:28 +02:00
parent 03158c3bbc
commit b577cdab5d

View File

@ -251,7 +251,7 @@ GridView::verifySize()
const int itemsPerRow = qMax( 1, qFloor( rectWidth / itemWidth ) );
const int overlapRows = m_model->rowCount( QModelIndex() ) % itemsPerRow;
const int rows = floor( (double)m_model->rowCount( QModelIndex() ) / (double)itemsPerRow );
const int rows = qMax( 1.0, floor( (double)m_model->rowCount( QModelIndex() ) / (double)itemsPerRow ) );
const int newHeight = rows * m_delegate->itemSize().height();
m_proxyModel->setMaxVisibleItems( m_model->rowCount( QModelIndex() ) - overlapRows );