Commit c60dc271 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Rémi Denis-Courmont

Playlist: Allow pausing the playback using space.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 972e458c
......@@ -385,6 +385,17 @@ void PlListView::dragMoveEvent ( QDragMoveEvent * event )
QAbstractItemView::dragMoveEvent( event );
}
void PlListView::keyPressEvent( QKeyEvent *event )
{
//If the space key is pressed, override the standard list behaviour to allow pausing
//to proceed.
if ( event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_Space )
QWidget::keyPressEvent( event );
//Otherwise, just do as usual.
else
QListView::keyPressEvent( event );
}
void PlTreeView::startDrag ( Qt::DropActions supportedActions )
{
plViewStartDrag( this, supportedActions );
......@@ -395,3 +406,14 @@ void PlTreeView::dragMoveEvent ( QDragMoveEvent * event )
plViewDragMoveEvent( this, event );
QAbstractItemView::dragMoveEvent( event );
}
void PlTreeView::keyPressEvent( QKeyEvent *event )
{
//If the space key is pressed, override the standard list behaviour to allow pausing
//to proceed.
if ( event->modifiers() == Qt::NoModifier && event->key() == Qt::Key_Space )
QWidget::keyPressEvent( event );
//Otherwise, just do as usual.
else
QTreeView::keyPressEvent( event );
}
......@@ -82,6 +82,7 @@ public:
private:
void startDrag ( Qt::DropActions supportedActions );
void dragMoveEvent ( QDragMoveEvent * event );
void keyPressEvent( QKeyEvent *event );
};
class PlTreeView : public QTreeView
......@@ -91,6 +92,7 @@ class PlTreeView : public QTreeView
private:
void startDrag ( Qt::DropActions supportedActions );
void dragMoveEvent ( QDragMoveEvent * event );
void keyPressEvent( QKeyEvent *event );
};
#endif
......
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