[vlc-commits] Partial revert "qt: Convert seek slider wheel events to actions"
Hugo Beauzée-Luyssen
git at videolan.org
Thu Apr 19 13:24:22 CEST 2018
vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Apr 19 11:25:05 2018 +0200| [c1ee86d7c16adf11b669c32bdfe9cf04ed494fb4] | committer: Hugo Beauzée-Luyssen
Partial revert "qt: Convert seek slider wheel events to actions"
This partially reverts commit 8314cd6ce6774e7086b0ed67567bea2fdeb15895.
(cherry picked from commit 089482408148232a8afcec803336f00f352acde4)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c1ee86d7c16adf11b669c32bdfe9cf04ed494fb4
---
modules/gui/qt/util/input_slider.cpp | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/modules/gui/qt/util/input_slider.cpp b/modules/gui/qt/util/input_slider.cpp
index b612354832..75c666ca01 100644
--- a/modules/gui/qt/util/input_slider.cpp
+++ b/modules/gui/qt/util/input_slider.cpp
@@ -35,8 +35,6 @@
#include "input_manager.hpp"
#include "imagehelper.hpp"
-#include <vlc_actions.h>
-
#include <QPaintEvent>
#include <QPainter>
#include <QBitmap>
@@ -403,10 +401,11 @@ void SeekSlider::wheelEvent( QWheelEvent *event )
/* Don't do anything if we are for somehow reason sliding */
if( !isSliding && isEnabled() )
{
- if ( event->delta() > 0 )
- var_SetInteger( p_intf->obj.libvlc, "key-action", ACTIONID_JUMP_BACKWARD_SHORT );
- else
- var_SetInteger( p_intf->obj.libvlc, "key-action", ACTIONID_JUMP_FORWARD_SHORT );
+ setValue( value() + event->delta() / 12 ); /* 12 = 8 * 15 / 10
+ Since delta is in 1/8 of ° and mouse have steps of 15 °
+ and that our slider is in 0.1% and we want one step to be a 1%
+ increment of position */
+ emit sliderDragged( value() / static_cast<float>( maximum() ) );
}
event->accept();
}
More information about the vlc-commits
mailing list