mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 05:07:27 +02:00
* Safe approach to prevent resizing of album items.
This commit is contained in:
@@ -208,7 +208,7 @@ AlbumView::onScrollTimeout()
|
|||||||
void
|
void
|
||||||
AlbumView::paintEvent( QPaintEvent* event )
|
AlbumView::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
if ( m_inited )
|
if ( !autoFitItems() || m_inited || !m_proxyModel->rowCount() )
|
||||||
QListView::paintEvent( event );
|
QListView::paintEvent( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,12 +216,8 @@ AlbumView::paintEvent( QPaintEvent* event )
|
|||||||
void
|
void
|
||||||
AlbumView::resizeEvent( QResizeEvent* event )
|
AlbumView::resizeEvent( QResizeEvent* event )
|
||||||
{
|
{
|
||||||
QListView::resizeEvent( event );
|
if ( autoFitItems() )
|
||||||
|
{
|
||||||
m_inited = true;
|
|
||||||
if ( !autoFitItems() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
int scrollbar = !verticalScrollBar()->isVisible() ? verticalScrollBar()->rect().width() : 0;
|
int scrollbar = !verticalScrollBar()->isVisible() ? verticalScrollBar()->rect().width() : 0;
|
||||||
#else
|
#else
|
||||||
@@ -238,6 +234,12 @@ AlbumView::resizeEvent( QResizeEvent* event )
|
|||||||
setSpacing( 16 );
|
setSpacing( 16 );
|
||||||
else
|
else
|
||||||
setSpacing( newSpacing );
|
setSpacing( newSpacing );
|
||||||
|
|
||||||
|
if ( !m_inited && m_proxyModel->rowCount() )
|
||||||
|
m_inited = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QListView::resizeEvent( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user