Skip to content

Commit 0d4bb0c

Browse files
committed
Add double click action for smart checkout in commit/branch searching
1 parent f1307fe commit 0d4bb0c

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

GitUpKit/Components/Base.lproj/GICommitListViewController.xib

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097.2"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
@@ -15,11 +15,11 @@
1515
</customObject>
1616
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
1717
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
18-
<view translatesAutoresizingMaskIntoConstraints="NO" id="Mge-gB-T5T" userLabel="Main View" customClass="GIView">
18+
<view id="Mge-gB-T5T" userLabel="Main View" customClass="GIView">
1919
<rect key="frame" x="0.0" y="0.0" width="310" height="500"/>
2020
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2121
<subviews>
22-
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="71" horizontalPageScroll="10" verticalLineScroll="71" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" id="AJL-NY-aX0">
22+
<scrollView fixedFrame="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="71" horizontalPageScroll="10" verticalLineScroll="71" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="AJL-NY-aX0">
2323
<rect key="frame" x="0.0" y="0.0" width="310" height="500"/>
2424
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2525
<clipView key="contentView" id="rt3-aj-SED">
@@ -34,7 +34,6 @@
3434
<tableColumns>
3535
<tableColumn editable="NO" width="310" minWidth="40" maxWidth="1000" id="jYE-Dh-d6l">
3636
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
37-
<font key="font" metaFont="toolTip"/>
3837
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
3938
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
4039
</tableHeaderCell>
@@ -49,38 +48,38 @@
4948
<rect key="frame" x="0.0" y="0.0" width="310" height="71"/>
5049
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
5150
<subviews>
52-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="aSE-41-Faa">
51+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aSE-41-Faa">
5352
<rect key="frame" x="12" y="52" width="84" height="14"/>
5453
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
5554
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="&lt;SHA1&gt;" id="vGZ-yd-Q3L">
56-
<font key="font" metaFont="toolTip"/>
55+
<font key="font" metaFont="controlContent" size="11"/>
5756
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
5857
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
5958
</textFieldCell>
6059
</textField>
61-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="l20-Zd-aeU">
60+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="l20-Zd-aeU">
6261
<rect key="frame" x="164" y="52" width="128" height="14"/>
6362
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
6463
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="right" title="&lt;DATE&gt;" id="fnB-nM-Xez">
65-
<font key="font" metaFont="toolTip"/>
64+
<font key="font" metaFont="controlContent" size="11"/>
6665
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
6766
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
6867
</textFieldCell>
6968
</textField>
70-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" setsMaxLayoutWidthAtFirstLayout="YES" id="T2M-SH-2iE">
69+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="T2M-SH-2iE">
7170
<rect key="frame" x="12" y="30" width="280" height="14"/>
7271
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
7372
<textFieldCell key="cell" controlSize="small" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="&lt;SUMMARY&gt;" id="ldy-6V-89y">
74-
<font key="font" metaFont="toolTip"/>
73+
<font key="font" metaFont="controlContent" size="11"/>
7574
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
7675
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
7776
</textFieldCell>
7877
</textField>
79-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="hoX-uL-0Vn">
78+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hoX-uL-0Vn">
8079
<rect key="frame" x="12" y="8" width="280" height="14"/>
8180
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
8281
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="&lt;AUTHOR&gt;" id="Wfd-kf-H2a">
83-
<font key="font" metaFont="toolTip"/>
82+
<font key="font" metaFont="controlContent" size="11"/>
8483
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
8584
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
8685
</textFieldCell>
@@ -97,20 +96,20 @@
9796
<rect key="frame" x="0.0" y="71" width="310" height="49"/>
9897
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
9998
<subviews>
100-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="n3I-nl-DwW">
99+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="n3I-nl-DwW">
101100
<rect key="frame" x="12" y="30" width="84" height="14"/>
102101
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
103102
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="&lt;TYPE&gt;" id="opM-4b-OCF">
104-
<font key="font" metaFont="toolTip"/>
103+
<font key="font" metaFont="controlContent" size="11"/>
105104
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
106105
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
107106
</textFieldCell>
108107
</textField>
109-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="mTb-0f-1hd">
108+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mTb-0f-1hd">
110109
<rect key="frame" x="12" y="8" width="280" height="14"/>
111110
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
112111
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="&lt;NAME&gt;" id="HEY-qh-9fe">
113-
<font key="font" metaFont="toolTip"/>
112+
<font key="font" metaFont="controlContent" size="11"/>
114113
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
115114
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
116115
</textFieldCell>
@@ -125,6 +124,7 @@
125124
</tableColumn>
126125
</tableColumns>
127126
<connections>
127+
<action trigger="doubleAction" selector="doubleClicked:" target="-2" id="o2z-8a-lK5"/>
128128
<outlet property="dataSource" destination="-2" id="aXy-CE-1i1"/>
129129
<outlet property="delegate" destination="-2" id="RSX-r7-nqv"/>
130130
</connections>
@@ -140,7 +140,7 @@
140140
<autoresizingMask key="autoresizingMask"/>
141141
</scroller>
142142
</scrollView>
143-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="2ZB-wM-XaF">
143+
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2ZB-wM-XaF">
144144
<rect key="frame" x="73" y="252" width="164" height="18"/>
145145
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
146146
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="center" title="&lt;EMPTY&gt;" id="t3C-dG-D6U">

GitUpKit/Components/GICommitListViewController.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,23 @@ - (void)tableViewSelectionDidChange:(NSNotification*)notification {
245245
}
246246
}
247247

248+
- (void)smartCheckoutSelectedCommit {
249+
GCHistoryCommit* commit = [self selectedCommit];
250+
[self.repository smartCheckoutCommit:commit window:self.view.window];
251+
}
252+
248253
- (void)keyDown:(NSEvent*)event {
249254
if (event.keyCode == kGIKeyCode_Return) {
250-
GCHistoryCommit* commit = [self selectedCommit];
251-
[self.repository smartCheckoutCommit:commit window:self.view.window];
255+
[self smartCheckoutSelectedCommit];
252256
} else {
253257
[super keyDown:event];
254258
}
255259
}
256260

261+
#pragma mark - Actions
262+
263+
- (IBAction)doubleClicked:(id)sender {
264+
[self smartCheckoutSelectedCommit];
265+
}
266+
257267
@end

0 commit comments

Comments
 (0)