Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
454
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
fb2f15e6
Commit
fb2f15e6
authored
2 months ago
by
Fatih Uzunoğlu
Committed by
Jean-Baptiste Kempf
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
qml: handle high precision adjustment and use `WheelToVLCConverter` in `PlaybackSpeedButton.qml`
parent
e0059c3c
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
+37
-25
37 additions, 25 deletions
.../qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
with
37 additions
and
25 deletions
modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
+
37
−
25
View file @
fb2f15e6
...
...
@@ -78,39 +78,51 @@ PopupIconToolButton {
z
:
-
1
WheelToVLCConverter
{
id
:
wheelToVLC
function
handle
(
steps
:
int
)
{
let
func
if
(
steps
>
0
)
func
=
root
.
popup
.
contentItem
.
slider
.
increase
else
func
=
root
.
popup
.
contentItem
.
slider
.
decrease
for
(
let
i
=
0
;
i
<
Math
.
abs
(
steps
);
++
i
)
func
()
}
Component.onCompleted
:
{
wheelUpDown
.
connect
(
wheelToVLC
.
handle
)
wheelLeftRight
.
connect
(
wheelToVLC
.
handle
)
}
}
WheelHandler
{
onWheel
:
(
event
)
=>
{
onWheel
:
(
wheel
)
=>
{
if
(
!
root
.
popup
.
contentItem
||
!
root
.
popup
.
contentItem
.
slider
)
{
event
.
accepted
=
false
return
}
let
delta
=
0
if
(
event
.
angleDelta
.
x
)
delta
=
event
.
angleDelta
.
x
else
if
(
event
.
angleDelta
.
y
)
delta
=
event
.
angleDelta
.
y
else
{
event
.
accepted
=
false
return
// NOTE: Uncomment below to support (not only handle) high precision adjustment:
// if ((Math.abs(wheel.pixelDelta.x) % 120 > 0) || (Math.abs(wheel.pixelDelta.y) % 120 > 0)) {
// let delta = 0
// if (Math.abs(wheel.pixelDelta.x) > Math.abs(wheel.pixelDelta.y))
// delta = wheel.pixelDelta.x
// else
// delta = wheel.pixelDelta.y
// if (wheel.inverted)
// delta = -delta
// root.popup.contentItem.slider.value += 0.01 * delta
// } else
{
wheelToVLC
.
qmlWheelEvent
(
wheel
)
}
if
(
event
.
inverted
)
delta
=
-
delta
event
.
accepted
=
true
delta
=
delta
/
8
/
15
let
func
if
(
delta
>
0
)
func
=
root
.
popup
.
contentItem
.
slider
.
increase
else
func
=
root
.
popup
.
contentItem
.
slider
.
decrease
for
(
let
i
=
0
;
i
<
Math
.
ceil
(
Math
.
abs
(
delta
));
++
i
)
func
()
wheel
.
accepted
=
true
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment