[vlc-commits] macosx: add key equivalents to vout menu matching the main menu
Felix Paul Kühne
git at videolan.org
Mon Aug 19 13:40:47 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Mon Aug 19 13:08:17 2019 +0200| [df0ecabdfb9fc900fe326937ea7dbf792d72f6ac] | committer: Felix Paul Kühne
macosx: add key equivalents to vout menu matching the main menu
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df0ecabdfb9fc900fe326937ea7dbf792d72f6ac
---
modules/gui/macosx/menus/VLCMainMenu.m | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m
index 2a20fc8406..059cecf3ad 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.m
+++ b/modules/gui/macosx/menus/VLCMainMenu.m
@@ -87,6 +87,10 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
@end
+ at interface NSMenuItem (KeyEquivalentAddition)
+- (void)matchKeyEquivalentsOfMenuItem:(NSMenuItem *)menuItem;
+ at end
+
@interface VLCMainMenu() <NSMenuDelegate>
{
VLCAboutWindowController *_aboutWindowController;
@@ -296,6 +300,17 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
[menuItem setTag:scaleValues[i].scaleValue];
[menuItem setTarget: self];
}
+
+ [_voutMenuplay matchKeyEquivalentsOfMenuItem:_play];
+ [_voutMenustop matchKeyEquivalentsOfMenuItem:_stop];
+ [_voutMenunext matchKeyEquivalentsOfMenuItem:_next];
+ [_voutMenuprev matchKeyEquivalentsOfMenuItem:_previous];
+ [_voutMenuRecord matchKeyEquivalentsOfMenuItem:_record];
+ [_voutMenuvolup matchKeyEquivalentsOfMenuItem:_vol_up];
+ [_voutMenuvoldown matchKeyEquivalentsOfMenuItem:_vol_down];
+ [_voutMenumute matchKeyEquivalentsOfMenuItem:_mute];
+ [_voutMenufullscreen matchKeyEquivalentsOfMenuItem:_fullscreenItem];
+ [_voutMenusnapshot matchKeyEquivalentsOfMenuItem:_snapshot];
}
- (void)setupMenu:(NSMenu *)menu withIntList:(char *)psz_name andSelector:(SEL)selector
@@ -1931,3 +1946,13 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
}
@end
+
+ at implementation NSMenuItem (KeyEquivalentAddition)
+
+- (void)matchKeyEquivalentsOfMenuItem:(NSMenuItem *)menuItem
+{
+ self.keyEquivalent = menuItem.keyEquivalent;
+ self.keyEquivalentModifierMask = menuItem.keyEquivalentModifierMask;
+}
+
+ at end
More information about the vlc-commits
mailing list