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:
parent
03158c3bbc
commit
b577cdab5d
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user