Commit 49d87527 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Ctrl+mousewheel to zoom on playlist

parent 305917c3
......@@ -455,6 +455,13 @@ void StandardPLPanel::browseInto()
void StandardPLPanel::wheelEvent( QWheelEvent *e )
{
if( e->modifiers() & Qt::ControlModifier ) {
int numSteps = e->delta() / 8 / 15;
if( numSteps > 0)
increaseZoom();
else if( numSteps < 0)
decreaseZoom();
}
// Accept this event in order to prevent unwanted volume up/down changes
e->accept();
}
......
......@@ -72,6 +72,7 @@ public:
int currentViewIndex() const;
static QMenu *viewSelectionMenu(StandardPLPanel *obj);
protected:
PLModel *model;
MLModel *mlmodel;
......
......@@ -344,10 +344,15 @@ bool PlIconView::viewportEvent ( QEvent * event )
event->ignore();
return true;
}
else
else if ( event->type() == QEvent::Wheel )
{
return QAbstractItemView::viewportEvent( event );
QWheelEvent *wEvent = static_cast<QWheelEvent *>(event);
if( wEvent->modifiers() & Qt::ControlModifier ) {
event->ignore();
return true;
}
}
return QAbstractItemView::viewportEvent( event );
}
PlListView::PlListView( PLModel *, QWidget *parent ) : QListView( parent )
......@@ -396,10 +401,15 @@ bool PlListView::viewportEvent ( QEvent * event )
event->ignore();
return true;
}
else
else if ( event->type() == QEvent::Wheel )
{
return QAbstractItemView::viewportEvent( event );
QWheelEvent *wEvent = static_cast<QWheelEvent *>(event);
if( wEvent->modifiers() & Qt::ControlModifier ) {
event->ignore();
return true;
}
}
return QAbstractItemView::viewportEvent( event );
}
PlTreeView::PlTreeView( PLModel *, QWidget *parent ) : QTreeView( parent )
......@@ -560,8 +570,13 @@ bool PicFlowView::viewportEvent ( QEvent * event )
event->ignore();
return true;
}
else
else if ( event->type() == QEvent::Wheel )
{
return QAbstractItemView::viewportEvent( event );
QWheelEvent *wEvent = static_cast<QWheelEvent *>(event);
if( wEvent->modifiers() & Qt::ControlModifier ) {
event->ignore();
return true;
}
}
return QAbstractItemView::viewportEvent( event );
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment