Commit e881d320 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: correctly handle mousewheel in selector

Close #6812
(cherry picked from commit 16c1b2916cf36a8e9c218ab856a62f289f6d2d80)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b3354a63
......@@ -31,6 +31,7 @@
#include "playlist_model.hpp" /* plMimeData */
#include "input_manager.hpp" /* MainInputManager, for podcast */
#include <QApplication>
#include <QInputDialog>
#include <QMessageBox>
#include <QMimeData>
......@@ -39,6 +40,7 @@
#include <QHBoxLayout>
#include <QPainter>
#include <QPalette>
#include <QScrollBar>
#include <vlc_playlist.h>
#include <vlc_services_discovery.h>
......@@ -550,6 +552,12 @@ int PLSelector::getCurrentItemCategory()
void PLSelector::wheelEvent( QWheelEvent *e )
{
if( verticalScrollBar()->isVisible() && (
(verticalScrollBar()->value() != verticalScrollBar()->minimum() && e->delta() >= 0 ) ||
(verticalScrollBar()->value() != verticalScrollBar()->maximum() && e->delta() < 0 )
) )
QApplication::sendEvent(verticalScrollBar(), e);
// Accept this event in order to prevent unwanted volume up/down changes
e->accept();
}
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