mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
* Fixed auto-resizing of GridViews for when we have exactly one row.
This commit is contained in:
@@ -251,7 +251,7 @@ GridView::verifySize()
|
|||||||
const int itemsPerRow = qMax( 1, qFloor( rectWidth / itemWidth ) );
|
const int itemsPerRow = qMax( 1, qFloor( rectWidth / itemWidth ) );
|
||||||
|
|
||||||
const int overlapRows = m_model->rowCount( QModelIndex() ) % itemsPerRow;
|
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();
|
const int newHeight = rows * m_delegate->itemSize().height();
|
||||||
|
|
||||||
m_proxyModel->setMaxVisibleItems( m_model->rowCount( QModelIndex() ) - overlapRows );
|
m_proxyModel->setMaxVisibleItems( m_model->rowCount( QModelIndex() ) - overlapRows );
|
||||||
|
Reference in New Issue
Block a user