Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
af7cf494
Commit
af7cf494
authored
Sep 12, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: InputSlider: wheeling on it will seek of 1% in position.
parent
8b5d7fe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+16
-0
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+7
-1
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
af7cf494
...
...
@@ -107,6 +107,22 @@ void InputSlider::mouseMoveEvent(QMouseEvent *event)
setToolTip
(
psz_length
);
}
void
InputSlider
::
wheelEvent
(
QWheelEvent
*
event
)
{
/* Don't do anything if we are for somehow reason sliding */
if
(
!
b_sliding
)
{
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
()
/
1000.0
);
}
/* We do accept because for we don't want the parent to change the sound
vol */
event
->
accept
();
}
/* This work is derived from Amarok's work under GPLv2+
- Mark Kretschmann
- Gábor Lehel
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
af7cf494
...
...
@@ -27,9 +27,13 @@
#include "qt4.hpp"
#include <QAbstractSlider>
#include <QSlider>
#include <QMouseEvent>
#include <QWheelEvent>
/* Input Slider derived from QSlider */
class
InputSlider
:
public
QSlider
{
Q_OBJECT
...
...
@@ -41,6 +45,7 @@ protected:
virtual
void
mouseMoveEvent
(
QMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
virtual
void
wheelEvent
(
QWheelEvent
*
event
);
private:
bool
b_sliding
;
int
inputLength
;
...
...
@@ -54,8 +59,9 @@ signals:
};
/* Sound Slider inherited directly from QAbstractSlider */
class
QPaintEvent
;
#include <QAbstractSlider>
class
SoundSlider
:
public
QAbstractSlider
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment