Commit d3d1f6c6 authored by David Fuhrmann's avatar 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
parent 039f088a
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?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> <dependencies>
<deployment version="1070" identifier="macosx"/> <deployment version="1070" identifier="macosx"/>
<development version="7000" identifier="xcode"/> <development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
</dependencies> </dependencies>
<objects> <objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainMenu"> <customObject id="-2" userLabel="File's Owner" customClass="VLCMainMenu">
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<outlet property="extensions" destination="4942" id="qSU-2W-Chy"/> <outlet property="extensions" destination="4942" id="qSU-2W-Chy"/>
<outlet property="extensionsMenu" destination="4943" id="IAw-5Z-Wvo"/> <outlet property="extensionsMenu" destination="4943" id="IAw-5Z-Wvo"/>
<outlet property="fileMenu" destination="81" id="lbA-s5-6qj"/> <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="fittoscreen" destination="1514" id="79G-ad-1hf"/>
<outlet property="floatontop" destination="1499" id="yvd-Sz-zL3"/> <outlet property="floatontop" destination="1499" id="yvd-Sz-zL3"/>
<outlet property="forum" destination="2300" id="cpt-gZ-e4k"/> <outlet property="forum" destination="2300" id="cpt-gZ-e4k"/>
...@@ -352,6 +353,12 @@ ...@@ -352,6 +353,12 @@
<action selector="selectAll:" target="-1" id="232"/> <action selector="selectAll:" target="-1" id="232"/>
</connections> </connections>
</menuItem> </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> </items>
</menu> </menu>
</menuItem> </menuItem>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
@property (readwrite, weak) IBOutlet NSMenuItem *pasteItem; @property (readwrite, weak) IBOutlet NSMenuItem *pasteItem;
@property (readwrite, weak) IBOutlet NSMenuItem *clearItem; @property (readwrite, weak) IBOutlet NSMenuItem *clearItem;
@property (readwrite, weak) IBOutlet NSMenuItem *select_all; @property (readwrite, weak) IBOutlet NSMenuItem *select_all;
@property (readwrite, weak) IBOutlet NSMenuItem *findItem;
@property (readwrite, weak) IBOutlet NSMenu *viewMenu; @property (readwrite, weak) IBOutlet NSMenu *viewMenu;
@property (readwrite, weak) IBOutlet NSMenuItem *toggleJumpButtons; @property (readwrite, weak) IBOutlet NSMenuItem *toggleJumpButtons;
......
...@@ -330,6 +330,7 @@ ...@@ -330,6 +330,7 @@
[_pasteItem setTitle: _NS("Paste")]; [_pasteItem setTitle: _NS("Paste")];
[_clearItem setTitle: _NS("Delete")]; [_clearItem setTitle: _NS("Delete")];
[_select_all setTitle: _NS("Select All")]; [_select_all setTitle: _NS("Select All")];
[_findItem setTitle: _NS("Find")];
[_viewMenu setTitle: _NS("View")]; [_viewMenu setTitle: _NS("View")];
[_toggleJumpButtons setTitle: _NS("Show Previous & Next Buttons")]; [_toggleJumpButtons setTitle: _NS("Show Previous & Next Buttons")];
......
...@@ -104,6 +104,7 @@ typedef enum { ...@@ -104,6 +104,7 @@ typedef enum {
- (IBAction)removePodcastWindowAction:(id)sender; - (IBAction)removePodcastWindowAction:(id)sender;
- (IBAction)searchItem:(id)sender; - (IBAction)searchItem:(id)sender;
- (IBAction)highlightSearchField:(id)sender;
- (void)windowResizedOrMoved:(NSNotification *)notification; - (void)windowResizedOrMoved:(NSNotification *)notification;
......
...@@ -985,6 +985,11 @@ static const float f_min_window_height = 307.; ...@@ -985,6 +985,11 @@ static const float f_min_window_height = 307.;
[[[[VLCMain sharedInstance] playlist] model] searchUpdate:[_searchField stringValue]]; [[[[VLCMain sharedInstance] playlist] model] searchUpdate:[_searchField stringValue]];
} }
- (IBAction)highlightSearchField:(id)sender
{
[_searchField selectText:sender];
}
#pragma mark - #pragma mark -
#pragma mark Side Bar Data handling #pragma mark Side Bar Data handling
/* taken under BSD-new from the PXSourceList sample project, adapted for VLC */ /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
......
...@@ -245,7 +245,7 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id ...@@ -245,7 +245,7 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id
[_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)]; [_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)];
/* setup useful stuff */ /* 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) \ #define CreateToolbarItem(name, desc, img, sel) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment