Skip to content

Commit d73e70d

Browse files
committed
Fix some issues with Dark Mode on 10.14
1 parent e625224 commit d73e70d

File tree

5 files changed

+21
-25
lines changed

5 files changed

+21
-25
lines changed

Interfaces/English.lproj/UserManagerView.xib

+3-9
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="20" horizontalPageScroll="10" verticalLineScroll="20" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="28">
5353
<rect key="frame" x="0.0" y="23" width="177" height="483"/>
5454
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
55-
<clipView key="contentView" id="VfC-c0-tv4">
5655
<rect key="frame" x="0.0" y="17" width="177" height="466"/>
56+
<clipView key="contentView" drawsBackground="NO" id="VfC-c0-tv4">
5757
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
5858
<subviews>
5959
<outlineView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="20" headerView="923" indentationPerLevel="14" autoresizesOutlineColumn="YES" outlineTableColumn="33" id="31" customClass="SPOutlineView">
@@ -93,7 +93,6 @@
9393
</connections>
9494
</outlineView>
9595
</subviews>
96-
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
9796
</clipView>
9897
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="30">
9998
<rect key="frame" x="0.0" y="473" width="183" height="11"/>
@@ -865,7 +864,7 @@ DQ
865864
<rect key="frame" x="0.0" y="0.0" width="163" height="363"/>
866865
<autoresizingMask key="autoresizingMask"/>
867866
<size key="intercellSpacing" width="3" height="2"/>
868-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
867+
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
869868
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
870869
<tableColumns>
871870
<tableColumn identifier="Schemas" editable="NO" width="160" minWidth="40" maxWidth="1000" id="750">
@@ -888,7 +887,6 @@ DQ
888887
</connections>
889888
</tableView>
890889
</subviews>
891-
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
892890
</clipView>
893891
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="747">
894892
<rect key="frame" x="1" y="369" width="109" height="11"/>
@@ -944,7 +942,6 @@ DQ
944942
</connections>
945943
</tableView>
946944
</subviews>
947-
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
948945
</clipView>
949946
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="771">
950947
<rect key="frame" x="1" y="369" width="109" height="11"/>
@@ -970,7 +967,7 @@ DQ
970967
<rect key="frame" x="0.0" y="0.0" width="163" height="363"/>
971968
<autoresizingMask key="autoresizingMask"/>
972969
<size key="intercellSpacing" width="3" height="2"/>
973-
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
970+
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
974971
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
975972
<tableColumns>
976973
<tableColumn identifier="Available Privilige" editable="NO" width="160" minWidth="40" maxWidth="1000" id="780">
@@ -1000,7 +997,6 @@ DQ
1000997
</connections>
1001998
</tableView>
1002999
</subviews>
1003-
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
10041000
</clipView>
10051001
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="778">
10061002
<rect key="frame" x="1" y="369" width="109" height="11"/>
@@ -1333,8 +1329,6 @@ Some changes may have already been applied; please review the errors below befor
13331329
<size key="minSize" width="405" height="115"/>
13341330
<size key="maxSize" width="463" height="10000000"/>
13351331
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
1336-
<size key="minSize" width="405" height="115"/>
1337-
<size key="maxSize" width="463" height="10000000"/>
13381332
</textView>
13391333
</subviews>
13401334
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>

Source/SPCustomQuery.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ - (void)tableView:(SPCopyTable *)aTableView willDisplayCell:(id)cell forTableCol
21122112
showCellAsGray = [resultData cellIsNullOrUnloadedAtRow:rowIndex column:columnIndex];
21132113
}
21142114

2115-
[cell setTextColor:showCellAsGray ? [NSColor lightGrayColor] : [NSColor blackColor]];
2115+
[cell setTextColor:showCellAsGray ? [NSColor lightGrayColor] : [NSColor controlTextColor]];
21162116
}
21172117
}
21182118

@@ -3403,7 +3403,8 @@ - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)aFieldEdit
34033403
}
34043404

34053405
// Set editing color to black for NULL values while editing
3406-
[aFieldEditor setTextColor:[NSColor blackColor]];
3406+
// TODO: This method won't be called until the user actually starts typing. The tableView's willDisplayCell delegate call is the proper place to update this (see SPTableContent)
3407+
[aFieldEditor setTextColor:[NSColor controlTextColor]];
34073408

34083409
return shouldBeginEditing;
34093410
}

Source/SPTableContent.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,9 @@ typedef NS_ENUM(NSInteger, SPTableContentFilterSource) {
157157
NSString *kCellEditorErrorNoMultiTabDb;
158158
NSString *kCellEditorErrorTooManyMatches;
159159

160-
NSColor *blackColor;
161-
NSColor *lightGrayColor;
162-
NSColor *blueColor;
163-
NSColor *whiteColor;
160+
NSColor *textForegroundColor;
161+
NSColor *nullHighlightColor;
162+
NSColor *binhexHighlightColor;
164163

165164
SPFieldEditorController *fieldEditor;
166165

Source/SPTableContent.m

+11-9
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,9 @@ - (id)init
187187

188188
tableLoadTimer = nil;
189189

190-
blackColor = [NSColor blackColor];
191-
lightGrayColor = [NSColor lightGrayColor];
192-
blueColor = [NSColor blueColor];
193-
whiteColor = [NSColor whiteColor];
190+
textForegroundColor = [NSColor controlTextColor]; // this color dynamically adapts to the rest of the UI
191+
nullHighlightColor = [NSColor lightGrayColor];
192+
binhexHighlightColor = [NSColor blueColor];
194193

195194
kCellEditorErrorNoMatch = NSLocalizedString(@"Field is not editable. No matching record found.\nReload table, check the encoding, or try to add\na primary key field or more fields\nin the view declaration of '%@' to identify\nfield origin unambiguously.", @"Table Content result editing error - could not identify original row");
196195
kCellEditorErrorNoMultiTabDb = NSLocalizedString(@"Field is not editable. Field has no or multiple table or database origin(s).",@"field is not editable due to no table/database");
@@ -4337,7 +4336,7 @@ - (void)tableView:(SPCopyTable *)tableView willDisplayCell:(id)cell forTableColu
43374336
if ([tableView editedColumn] != -1
43384337
&& [tableView editedRow] == rowIndex
43394338
&& (NSUInteger)[[NSArrayObjectAtIndex([tableView tableColumns], [tableView editedColumn]) identifier] integerValue] == columnIndex) {
4340-
[cell setTextColor:blackColor];
4339+
[cell setTextColor:textForegroundColor];
43414340
if (cellIsLinkCell) [cell setLinkActive:NO];
43424341
return;
43434342
}
@@ -4359,13 +4358,16 @@ - (void)tableView:(SPCopyTable *)tableView willDisplayCell:(id)cell forTableColu
43594358
}
43604359

43614360
if (cellIsNullOrUnloaded) {
4362-
[cell setTextColor:rowIndex == [tableContentView selectedRow] ? whiteColor : lightGrayColor];
4361+
[cell setTextColor:(rowIndex == [tableContentView selectedRow] ? textForegroundColor : nullHighlightColor)];
43634362
}
43644363
else {
4365-
[cell setTextColor:blackColor];
4364+
[cell setTextColor:textForegroundColor];
43664365

4367-
if ([self cellValueIsDisplayedAsHexForColumn:[[tableColumn identifier] integerValue]]) {
4368-
[cell setTextColor:rowIndex == [tableContentView selectedRow] ? whiteColor : blueColor];
4366+
if (
4367+
[self cellValueIsDisplayedAsHexForColumn:[[tableColumn identifier] integerValue]] &&
4368+
rowIndex != [tableContentView selectedRow]
4369+
) {
4370+
[cell setTextColor:binhexHighlightColor];
43694371
}
43704372
}
43714373

Source/SPUserManager.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ - (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColu
15971597
if ([schemaName isEqualToString:@""] || [schemaName isEqualToString:@"%"]) {
15981598
[cell setTextColor:[NSColor lightGrayColor]];
15991599
} else {
1600-
[cell setTextColor:[NSColor blackColor]];
1600+
[cell setTextColor:[NSColor controlTextColor]];
16011601
}
16021602

16031603
// If the schema has permissions set, highlight with a yellow background

0 commit comments

Comments
 (0)