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() ...@@ -455,6 +455,13 @@ void StandardPLPanel::browseInto()
void StandardPLPanel::wheelEvent( QWheelEvent *e ) 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 // Accept this event in order to prevent unwanted volume up/down changes
e->accept(); e->accept();
} }
......
...@@ -72,6 +72,7 @@ public: ...@@ -72,6 +72,7 @@ public:
int currentViewIndex() const; int currentViewIndex() const;
static QMenu *viewSelectionMenu(StandardPLPanel *obj); static QMenu *viewSelectionMenu(StandardPLPanel *obj);
protected: protected:
PLModel *model; PLModel *model;
MLModel *mlmodel; MLModel *mlmodel;
......
...@@ -344,10 +344,15 @@ bool PlIconView::viewportEvent ( QEvent * event ) ...@@ -344,10 +344,15 @@ bool PlIconView::viewportEvent ( QEvent * event )
event->ignore(); event->ignore();
return true; 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 ) PlListView::PlListView( PLModel *, QWidget *parent ) : QListView( parent )
...@@ -396,10 +401,15 @@ bool PlListView::viewportEvent ( QEvent * event ) ...@@ -396,10 +401,15 @@ bool PlListView::viewportEvent ( QEvent * event )
event->ignore(); event->ignore();
return true; 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 ) PlTreeView::PlTreeView( PLModel *, QWidget *parent ) : QTreeView( parent )
...@@ -560,8 +570,13 @@ bool PicFlowView::viewportEvent ( QEvent * event ) ...@@ -560,8 +570,13 @@ bool PicFlowView::viewportEvent ( QEvent * event )
event->ignore(); event->ignore();
return true; 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