vlc | branch: master | David Fuhrmann <[email protected]> | Sat Apr 23 10:23:12 2016 +0200| [d3d1f6c646e656a19d3092397934040d4512db4c] | committer: David Fuhrmann
macosx: Add Find menu item and key shortcut According to HIG, Command+F shall be used, but as it is already taken by fullscreen, lets use Command+Shift+F. refs #13865 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d3d1f6c646e656a19d3092397934040d4512db4c --- extras/package/macosx/Resources/English.lproj/MainMenu.xib | 11 +++++++++-- modules/gui/macosx/MainMenu.h | 1 + modules/gui/macosx/MainMenu.m | 1 + modules/gui/macosx/MainWindow.h | 1 + modules/gui/macosx/MainWindow.m | 5 +++++ modules/gui/macosx/simple_prefs.m | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib index c4e9cba..332c4e6 100644 --- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib +++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15F24b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <dependencies> <deployment version="1070" identifier="macosx"/> <development version="7000" identifier="xcode"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="VLCMainMenu"> @@ -53,6 +53,7 @@ <outlet property="extensions" destination="4942" id="qSU-2W-Chy"/> <outlet property="extensionsMenu" destination="4943" id="IAw-5Z-Wvo"/> <outlet property="fileMenu" destination="81" id="lbA-s5-6qj"/> + <outlet property="findItem" destination="6J6-tz-ctn" id="eZU-nd-y0B"/> <outlet property="fittoscreen" destination="1514" id="79G-ad-1hf"/> <outlet property="floatontop" destination="1499" id="yvd-Sz-zL3"/> <outlet property="forum" destination="2300" id="cpt-gZ-e4k"/> @@ -352,6 +353,12 @@ <action selector="selectAll:" target="-1" id="232"/> </connections> </menuItem> + <menuItem isSeparatorItem="YES" id="K9x-W6-ycv"/> + <menuItem title="Find" keyEquivalent="F" id="6J6-tz-ctn"> + <connections> + <action selector="highlightSearchField:" target="-1" id="GlP-7U-XF1"/> + </connections> + </menuItem> </items> </menu> </menuItem> diff --git a/modules/gui/macosx/MainMenu.h b/modules/gui/macosx/MainMenu.h index 91f9762..ce94855 100644 --- a/modules/gui/macosx/MainMenu.h +++ b/modules/gui/macosx/MainMenu.h @@ -60,6 +60,7 @@ @property (readwrite, weak) IBOutlet NSMenuItem *pasteItem; @property (readwrite, weak) IBOutlet NSMenuItem *clearItem; @property (readwrite, weak) IBOutlet NSMenuItem *select_all; +@property (readwrite, weak) IBOutlet NSMenuItem *findItem; @property (readwrite, weak) IBOutlet NSMenu *viewMenu; @property (readwrite, weak) IBOutlet NSMenuItem *toggleJumpButtons; diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m index aacc5f2..a55b630 100644 --- a/modules/gui/macosx/MainMenu.m +++ b/modules/gui/macosx/MainMenu.m @@ -330,6 +330,7 @@ [_pasteItem setTitle: _NS("Paste")]; [_clearItem setTitle: _NS("Delete")]; [_select_all setTitle: _NS("Select All")]; + [_findItem setTitle: _NS("Find")]; [_viewMenu setTitle: _NS("View")]; [_toggleJumpButtons setTitle: _NS("Show Previous & Next Buttons")]; diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h index 563b1e2..28c0e2a 100644 --- a/modules/gui/macosx/MainWindow.h +++ b/modules/gui/macosx/MainWindow.h @@ -104,6 +104,7 @@ typedef enum { - (IBAction)removePodcastWindowAction:(id)sender; - (IBAction)searchItem:(id)sender; +- (IBAction)highlightSearchField:(id)sender; - (void)windowResizedOrMoved:(NSNotification *)notification; diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m index 4415c34..19c3af8 100644 --- a/modules/gui/macosx/MainWindow.m +++ b/modules/gui/macosx/MainWindow.m @@ -985,6 +985,11 @@ static const float f_min_window_height = 307.; [[[[VLCMain sharedInstance] playlist] model] searchUpdate:[_searchField stringValue]]; } +- (IBAction)highlightSearchField:(id)sender +{ + [_searchField selectText:sender]; +} + #pragma mark - #pragma mark Side Bar Data handling /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */ diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m index 19fe964..077ad1e 100644 --- a/modules/gui/macosx/simple_prefs.m +++ b/modules/gui/macosx/simple_prefs.m @@ -245,7 +245,7 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id [_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)]; /* setup useful stuff */ - _hotkeysNonUseableKeys = [NSArray arrayWithObjects:@"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", nil]; + _hotkeysNonUseableKeys = [NSArray arrayWithObjects:@"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", @"Command-Shift-f", nil]; } #define CreateToolbarItem(name, desc, img, sel) \ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
