Skip to content

Commit 18664b2

Browse files
Set drag file label text color at launch
- To keep xib file deployable to 10.9 without warning, don't use named color in xib file - Add and connect outlet to drag file label - Add code to set text color of drag file label - Code is conditional to use named color on 10.13 and later
1 parent f0efe46 commit 18664b2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

BuildSettingExtractor/AppDelegate.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ @interface AppDelegate () <NSOpenSavePanelDelegate>
1919
@property (weak) IBOutlet NSWindow *window;
2020
@property (weak) IBOutlet DragFileView *dragFileView;
2121
@property (weak) IBOutlet NSWindow *preferencesWindow;
22+
@property (weak) IBOutlet NSTextField *dragFileLabel;
2223

2324
@property BOOL shouldOverwriteFiles;
2425

@@ -29,6 +30,11 @@ @implementation AppDelegate
2930
- (void)awakeFromNib {
3031
self.dragFileView.target = self;
3132
self.dragFileView.action = @selector(handleDroppedFile:);
33+
if (@available(macOS 10.13, *)) {
34+
self.dragFileLabel.textColor = [NSColor colorNamed:@"dragViewTextColor"];
35+
} else {
36+
self.dragFileLabel.textColor = [NSColor colorWithCalibratedRed:0.13 green:0.26 blue:0.42 alpha:1.0];
37+
}
3238
}
3339

3440

BuildSettingExtractor/Base.lproj/MainMenu.xib

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
1616
<customObject id="Voe-Tx-rLC" customClass="AppDelegate">
1717
<connections>
18+
<outlet property="dragFileLabel" destination="BCV-eh-b7F" id="bmh-es-81m"/>
1819
<outlet property="dragFileView" destination="THh-eD-rRa" id="zXq-Cy-fLL"/>
1920
<outlet property="preferencesWindow" destination="fKt-mn-0WB" id="QZi-jp-8Bf"/>
2021
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>

0 commit comments

Comments
 (0)