Skip to content
Permalink
Browse files

Merge pull request #2337 from iina/keybinding-searchbar

Add a search bar to filter key bindings
  • Loading branch information...
lhc70000 committed Mar 30, 2019
2 parents b2859e6 + 1e2f14d commit 532892fbdc3d4a919dfb7650a2597c9057cc98db
@@ -106,4 +106,5 @@ extension Notification.Name {
static let iinaFileLoaded = Notification.Name("IINAFileLoaded")
static let iinaHistoryUpdated = Notification.Name("IINAHistoryUpdated")
static let iinaLegacyFullScreen = Notification.Name("IINALegacyFullScreen")
static let iinaKeyBindingChanged = Notification.Name("iinaKeyBindingChanged")
}
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.13.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -13,7 +13,9 @@
<outlet property="configHintLabel" destination="tP6-Ua-acA" id="bRT-AA-zL7"/>
<outlet property="deleteConfFileBtn" destination="EpF-t6-PtC" id="3NC-Xb-5kT"/>
<outlet property="duplicateConfigBtn" destination="5WK-s3-J9x" id="Ri8-b5-d3s"/>
<outlet property="kbTableView" destination="1Z4-NL-6P3" id="v4p-E7-gvv"/>
<outlet property="kbTableView" destination="1Z4-NL-6P3" id="OyE-OE-MSd"/>
<outlet property="keyMappingSearchField" destination="x6N-6q-HiV" id="mRh-rd-I8d"/>
<outlet property="mappingController" destination="xGz-Vh-hMb" id="hDG-Z5-OmL"/>
<outlet property="newConfigBtn" destination="iCp-ho-SlQ" id="LI0-TX-tNs"/>
<outlet property="removeKmBtn" destination="uFG-OF-DJ5" id="XWN-Lt-tmc"/>
<outlet property="revealConfFileBtn" destination="KZA-hu-vhZ" id="lVg-3j-Qgp"/>
@@ -24,10 +26,10 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="695" height="505"/>
<rect key="frame" x="0.0" y="0.0" width="695" height="531"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="LU9-QU-BFL">
<rect key="frame" x="6" y="481" width="117" height="18"/>
<rect key="frame" x="6" y="507" width="117" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="14" id="lOm-I3-MpB"/>
</constraints>
@@ -40,7 +42,7 @@
</connections>
</button>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="ER0-iU-7fy">
<rect key="frame" x="8" y="444" width="679" height="5"/>
<rect key="frame" x="8" y="470" width="679" height="5"/>
</box>
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2pX-29-I87">
<rect key="frame" x="196" y="63" width="491" height="320"/>
@@ -67,6 +69,9 @@
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections>
<binding destination="xGz-Vh-hMb" name="value" keyPath="arrangedObjects.keyForDisplay" id="FWk-cQ-DIx"/>
</connections>
</tableColumn>
<tableColumn identifier="Action" width="367" minWidth="40" maxWidth="1000" id="4Bn-MF-dfY">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Action">
@@ -80,8 +85,15 @@
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<connections>
<binding destination="xGz-Vh-hMb" name="value" keyPath="arrangedObjects.actionForDisplay" id="lft-aO-sfz"/>
</connections>
</tableColumn>
</tableColumns>
<connections>
<binding destination="xGz-Vh-hMb" name="content" keyPath="arrangedObjects" id="msx-K3-0J4"/>
<binding destination="xGz-Vh-hMb" name="selectionIndexes" keyPath="selectionIndexes" previousBinding="msx-K3-0J4" id="Bzi-wl-Zks"/>
</connections>
</tableView>
</subviews>
</clipView>
@@ -102,7 +114,7 @@
</tableHeaderView>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZWR-gT-S2p">
<rect key="frame" x="8" y="413" width="91" height="17"/>
<rect key="frame" x="8" y="439" width="91" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Configuration:" id="au5-6f-s55">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -144,7 +156,7 @@
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="removeKeyMappingBtnAction:" target="-2" id="AMw-dz-4NC"/>
<action selector="removeKeyMappingBtnAction:" target="-2" id="aeN-fq-0zS"/>
</connections>
</button>
<button toolTip="Show the raw mpv key code and command." translatesAutoresizingMaskIntoConstraints="NO" id="l2M-TH-eCt">
@@ -155,6 +167,7 @@
</buttonCell>
<connections>
<action selector="displayRawValueAction:" target="-2" id="EX1-Ia-ua1"/>
<binding destination="XM5-Sj-lhw" name="value" keyPath="values.displayKeyBindingRawValues" id="MXC-5c-KeU"/>
</connections>
</button>
<box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="GnK-98-Zrg">
@@ -176,7 +189,7 @@
<color key="fillColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</box>
<button translatesAutoresizingMaskIntoConstraints="NO" id="LAx-AE-9wU">
<rect key="frame" x="6" y="461" width="203" height="18"/>
<rect key="frame" x="6" y="487" width="203" height="18"/>
<buttonCell key="cell" type="check" title="Enable Apple Remote support" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="e70-25-5E4">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -186,7 +199,7 @@
</connections>
</button>
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bm5-rb-Qjb">
<rect key="frame" x="664" y="476" width="25" height="25"/>
<rect key="frame" x="664" y="502" width="25" height="25"/>
<buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="vf9-A9-dKA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -196,13 +209,13 @@
</connections>
</button>
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mhk-DT-3CM">
<rect key="frame" x="8" y="63" width="180" height="320"/>
<rect key="frame" x="8" y="63" width="180" height="350"/>
<clipView key="contentView" id="4gB-i6-I71">
<rect key="frame" x="1" y="1" width="178" height="318"/>
<rect key="frame" x="1" y="1" width="178" height="348"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" floatsGroupRows="NO" id="AYj-6d-niF">
<rect key="frame" x="0.0" y="0.0" width="178" height="318"/>
<rect key="frame" x="0.0" y="0.0" width="178" height="348"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -336,15 +349,15 @@
<color key="fillColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</box>
<textField identifier="SectionTitleSettings" hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OY4-8W-63j">
<rect key="frame" x="642" y="488" width="55" height="17"/>
<rect key="frame" x="642" y="514" width="55" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Settings" id="veZ-Si-Hv5">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="tP6-Ua-acA">
<rect key="frame" x="8" y="391" width="679" height="18"/>
<rect key="frame" x="8" y="421" width="679" height="14"/>
<textFieldCell key="cell" controlSize="small" title="Label" id="M4N-eg-JA8">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
@@ -361,6 +374,21 @@
<action selector="importConfigBtnAction:" target="-2" id="m3a-yn-NIE"/>
</connections>
</button>
<searchField wantsLayer="YES" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="x6N-6q-HiV">
<rect key="frame" x="197" y="391" width="489" height="22"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" usesSingleLineMode="YES" bezelStyle="round" sendsSearchStringImmediately="YES" id="onw-J2-ic8">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</searchFieldCell>
<connections>
<binding destination="xGz-Vh-hMb" name="predicate" keyPath="filterPredicate" id="K4Z-5S-JAZ">
<dictionary key="options">
<string key="NSPredicateFormat">(readableAction contains[cd] $value) OR (prettyCommand contains[cd] $value)</string>
</dictionary>
</binding>
</connections>
</searchField>
</subviews>
<constraints>
<constraint firstItem="KZA-hu-vhZ" firstAttribute="top" secondItem="0le-1T-r5f" secondAttribute="bottom" constant="14" id="2Pk-ll-iUo"/>
@@ -370,20 +398,22 @@
<constraint firstAttribute="trailing" secondItem="tP6-Ua-acA" secondAttribute="trailing" constant="10" id="AGg-nV-dJe"/>
<constraint firstItem="bm5-rb-Qjb" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="LU9-QU-BFL" secondAttribute="trailing" constant="8" id="ASF-wJ-2pT"/>
<constraint firstItem="Le4-ai-PiB" firstAttribute="top" secondItem="Mhk-DT-3CM" secondAttribute="bottom" constant="-1" id="BKz-av-lUx"/>
<constraint firstItem="x6N-6q-HiV" firstAttribute="trailing" secondItem="1Z4-NL-6P3" secondAttribute="trailing" id="BNb-HG-BLr"/>
<constraint firstItem="x6N-6q-HiV" firstAttribute="top" secondItem="tP6-Ua-acA" secondAttribute="bottom" constant="8" id="Cf7-8P-UBX"/>
<constraint firstItem="Le4-ai-PiB" firstAttribute="trailing" secondItem="Mhk-DT-3CM" secondAttribute="trailing" id="DeO-7U-TYb"/>
<constraint firstItem="AuR-Lj-Iz4" firstAttribute="firstBaseline" secondItem="KZA-hu-vhZ" secondAttribute="firstBaseline" id="Hrm-F3-qj5"/>
<constraint firstItem="AuR-Lj-Iz4" firstAttribute="leading" secondItem="KZA-hu-vhZ" secondAttribute="trailing" constant="12" id="LWW-j6-UPY"/>
<constraint firstItem="mLe-eI-lIk" firstAttribute="top" secondItem="2pX-29-I87" secondAttribute="bottom" constant="-1" id="LeQ-qP-FVe"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="AuR-Lj-Iz4" secondAttribute="trailing" constant="8" id="M6E-Ra-d8q"/>
<constraint firstItem="Mhk-DT-3CM" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="8" id="OLU-oB-Se7"/>
<constraint firstItem="2pX-29-I87" firstAttribute="top" secondItem="Mhk-DT-3CM" secondAttribute="top" id="Pc1-MC-ctF"/>
<constraint firstAttribute="bottom" secondItem="KZA-hu-vhZ" secondAttribute="bottom" constant="8" id="QtF-OP-vXc"/>
<constraint firstItem="ER0-iU-7fy" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="8" id="Rc3-GT-Hhr"/>
<constraint firstAttribute="trailing" secondItem="mLe-eI-lIk" secondAttribute="trailing" constant="8" id="U9K-pE-0CL"/>
<constraint firstItem="Mhk-DT-3CM" firstAttribute="top" secondItem="tP6-Ua-acA" secondAttribute="bottom" constant="8" id="Ud4-VR-43k"/>
<constraint firstItem="2pX-29-I87" firstAttribute="leading" secondItem="Mhk-DT-3CM" secondAttribute="trailing" constant="8" id="VX8-3k-wdZ"/>
<constraint firstAttribute="trailing" secondItem="ER0-iU-7fy" secondAttribute="trailing" constant="8" id="Y4g-9e-aDt"/>
<constraint firstItem="ZWR-gT-S2p" firstAttribute="top" secondItem="ER0-iU-7fy" secondAttribute="bottom" constant="16" id="ZX7-1F-af0"/>
<constraint firstItem="2pX-29-I87" firstAttribute="top" secondItem="x6N-6q-HiV" secondAttribute="bottom" constant="8" id="aGz-Kt-wfl"/>
<constraint firstItem="Mhk-DT-3CM" firstAttribute="bottom" secondItem="2pX-29-I87" secondAttribute="bottom" id="bIy-L9-gJ1"/>
<constraint firstItem="Le4-ai-PiB" firstAttribute="leading" secondItem="Mhk-DT-3CM" secondAttribute="leading" id="bgz-zS-geZ"/>
<constraint firstItem="bm5-rb-Qjb" firstAttribute="centerY" secondItem="LU9-QU-BFL" secondAttribute="centerY" id="dVn-Pj-vDl"/>
@@ -393,7 +423,7 @@
<constraint firstAttribute="trailing" secondItem="OY4-8W-63j" secondAttribute="trailing" id="fZe-ej-w66"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="LAx-AE-9wU" secondAttribute="trailing" constant="20" symbolic="YES" id="jNW-B9-uvv"/>
<constraint firstItem="tP6-Ua-acA" firstAttribute="top" secondItem="ZWR-gT-S2p" secondAttribute="bottom" constant="4" id="krb-us-D9G"/>
<constraint firstItem="Mhk-DT-3CM" firstAttribute="top" secondItem="ZWR-gT-S2p" secondAttribute="bottom" constant="30" id="mYB-35-8YR"/>
<constraint firstItem="x6N-6q-HiV" firstAttribute="leading" secondItem="1Z4-NL-6P3" secondAttribute="leading" id="oGi-TP-9ub"/>
<constraint firstItem="tP6-Ua-acA" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="10" id="olF-Fw-cWs"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ZWR-gT-S2p" secondAttribute="trailing" constant="8" id="tWl-b9-AcQ"/>
<constraint firstAttribute="trailing" secondItem="2pX-29-I87" secondAttribute="trailing" constant="8" id="tl2-El-aGp"/>
@@ -406,6 +436,7 @@
<point key="canvasLocation" x="121.5" y="248.5"/>
</customView>
<userDefaultsController representsSharedInstance="YES" id="XM5-Sj-lhw"/>
<arrayController objectClassName="KeyMapping" id="xGz-Vh-hMb"/>
</objects>
<resources>
<image name="NSAddTemplate" width="11" height="11"/>
@@ -102,7 +102,7 @@ class FontPickerWindowController: NSWindowController, NSTableViewDelegate, NSTab
faceTableView.reloadData()
} else {
isSearching = true
filteredFontNames = fontNames.filter { $0.localizedName.lowercased() .contains(str.lowercased()) }
filteredFontNames = fontNames.filter { $0.localizedName.lowercased().contains(str.lowercased()) }
chosenFontMembers = nil
familyTableView.reloadData()
faceTableView.reloadData()
Oops, something went wrong.

0 comments on commit 532892f

Please sign in to comment.
You can’t perform that action at this time.