Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
04e7801f
Commit
04e7801f
authored
Sep 07, 2012
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: implemented scroll wheel behaviour for fullscreen volume slider, too
parent
da6798a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
31 deletions
+49
-31
modules/gui/macosx/fspanel.h
modules/gui/macosx/fspanel.h
+1
-1
modules/gui/macosx/misc.h
modules/gui/macosx/misc.h
+11
-1
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+37
-29
No files found.
modules/gui/macosx/fspanel.h
View file @
04e7801f
...
...
@@ -109,7 +109,7 @@
@end
@interface
VLCFSVolumeSlider
:
NSSlider
@interface
VLCFSVolumeSlider
:
VLCVolumeSliderCommon
{
}
-
(
void
)
drawKnobInRect
:
(
NSRect
)
knobRect
;
...
...
modules/gui/macosx/misc.h
View file @
04e7801f
...
...
@@ -144,11 +144,21 @@
@end
/*****************************************************************************
* VLCVolumeSliderCommon
*****************************************************************************/
@interface
VLCVolumeSliderCommon
:
NSSlider
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
;
@end
/*****************************************************************************
* ITSlider
*****************************************************************************/
@interface
ITSlider
:
NSSlider
@interface
ITSlider
:
VLCVolumeSliderCommon
{
NSImage
*
img
;
NSRect
image_rect
;
...
...
modules/gui/macosx/misc.m
View file @
04e7801f
...
...
@@ -663,6 +663,43 @@ void _drawFrameInRect(NSRect frameRect)
@end
/*****************************************************************************
* VLCVolumeSliderCommon
*****************************************************************************/
@implementation
VLCVolumeSliderCommon
:
NSSlider
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
{
intf_thread_t
*
p_intf
=
VLCIntf
;
CGFloat
f_deltaY
=
[
o_event
deltaY
];
CGFloat
f_deltaX
=
[
o_event
deltaX
];
if
(
!
OSX_SNOW_LEOPARD
&&
[
o_event
isDirectionInvertedFromDevice
])
f_deltaX
=
-
f_deltaX
;
// optimisation, actually double invertion of f_deltaY here
else
f_deltaY
=
-
f_deltaY
;
// positive for left / down, negative otherwise
CGFloat
f_delta
=
f_deltaX
+
f_deltaY
;
CGFloat
f_abs
;
int
i_vlckey
;
if
(
f_delta
>
0
.
0
f
)
{
i_vlckey
=
ACTIONID_VOL_DOWN
;
f_abs
=
f_delta
;
}
else
{
i_vlckey
=
ACTIONID_VOL_UP
;
f_abs
=
-
f_delta
;
}
for
(
NSUInteger
i
=
0
;
i
<
(
int
)(
f_abs
/
4
.
+
1
.)
&&
f_abs
>
0
.
05
;
i
++
)
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
i_vlckey
);
}
@end
/*****************************************************************************
* ITSlider
*****************************************************************************/
...
...
@@ -707,35 +744,6 @@ void _drawFrameInRect(NSRect frameRect)
[
self
drawKnobInRect
:
knobRect
];
}
-
(
void
)
scrollWheel
:(
NSEvent
*
)
o_event
{
intf_thread_t
*
p_intf
=
VLCIntf
;
CGFloat
f_deltaY
=
[
o_event
deltaY
];
CGFloat
f_deltaX
=
[
o_event
deltaX
];
if
(
!
OSX_SNOW_LEOPARD
&&
[
o_event
isDirectionInvertedFromDevice
])
f_deltaX
=
-
f_deltaX
;
// optimisation, actually double invertion of f_deltaY here
else
f_deltaY
=
-
f_deltaY
;
// positive for left / down, negative otherwise
CGFloat
f_delta
=
f_deltaX
+
f_deltaY
;
CGFloat
f_abs
;
int
i_vlckey
;
if
(
f_delta
>
0
.
0
f
)
{
i_vlckey
=
ACTIONID_VOL_DOWN
;
f_abs
=
f_delta
;
}
else
{
i_vlckey
=
ACTIONID_VOL_UP
;
f_abs
=
-
f_delta
;
}
for
(
NSUInteger
i
=
0
;
i
<
(
int
)(
f_abs
/
4
.
+
1
.)
&&
f_abs
>
0
.
05
;
i
++
)
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
i_vlckey
);
}
@end
/*****************************************************************************
...
...
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