1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

Fix scrolling in grid view.

This commit is contained in:
Teo Mrnjavac 2013-02-01 20:07:40 +01:00
parent 279c885dfe
commit 4ad22a82d4
2 changed files with 14 additions and 0 deletions

View File

@ -213,6 +213,19 @@ GridView::resizeEvent( QResizeEvent* event )
}
void GridView::wheelEvent( QWheelEvent* e )
{
#ifndef Q_WS_MAC
//HACK: Workaround for QTBUG-7232: Smooth scrolling (scroll per pixel) in ItemViews
// does not work as expected.
verticalScrollBar()->setSingleStep( delegate()->itemSize().height() / 8 );
// ^ scroll step is 1/8 of the estimated row height
#endif
QListView::wheelEvent( e );
}
void
GridView::verifySize()
{

View File

@ -91,6 +91,7 @@ protected:
void paintEvent( QPaintEvent* event );
void resizeEvent( QResizeEvent* event );
void wheelEvent( QWheelEvent* );
protected slots:
virtual void currentChanged( const QModelIndex& current, const QModelIndex& previous );