Skip to content

Commit 34ac528

Browse files
committed
Merge branch 'master' of https://github.com/nark/WiredClient
2 parents adb3487 + a368c4e commit 34ac528

File tree

2 files changed

+39
-12
lines changed

2 files changed

+39
-12
lines changed

Sources/WCChatController.m

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,10 +2612,10 @@ - (NSView *)tableView:(NSTableView *)tableView
26122612
} break;
26132613
}
26142614

2615-
if(row != [tableView selectedRow])
2615+
//if(row != [tableView selectedRow])
26162616
cellView.nickTextField.textColor = [WCUser colorForColor:[user color] idleTint:[user isIdle]];
2617-
else
2618-
cellView.nickTextField.textColor = [NSColor whiteColor];
2617+
//else
2618+
// cellView.nickTextField.textColor = [NSColor whiteColor];
26192619

26202620
[cellView.nickTextField setAllowsEditingTextAttributes:YES];
26212621

@@ -2635,11 +2635,17 @@ - (NSView *)tableView:(NSTableView *)tableView
26352635

26362636
cellView.nickTextField.attributedStringValue = [NSAttributedString attributedStringWithString:[user nick]
26372637
attributes:attributes];
2638-
26392638
cellView.nickTextField.toolTip = [user nick];
2640-
26412639
cellView.statusTextField.toolTip = [user status];
26422640
cellView.statusTextField.stringValue = [user status];
2641+
2642+
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
2643+
if (osxMode == nil) {
2644+
cellView.statusTextField.textColor = [NSColor colorWithCalibratedRed:153.0/255.0 green:153.0/255.0 blue:153.0/255.0 alpha:1.0]; //Light mode
2645+
} else {
2646+
cellView.statusTextField.textColor = [NSColor colorWithCalibratedRed:197.0/255.0 green:197.0/255.0 blue:197.0/255.0 alpha:1.0]; //Dark mode
2647+
}
2648+
26432649
cellView.imageView.image = [user iconWithIdleTint:YES];
26442650

26452651
return cellView;

Sources/WCUser.m

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,17 @@ @implementation WCUser
9696

9797
+ (NSColor *)colorForColor:(WCAccountColor)color idleTint:(BOOL)idleTint {
9898
NSColor *value;
99-
99+
100+
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
101+
100102
switch(color) {
101103
case WCAccountColorBlack:
102104
default:
103-
value = [NSColor colorWithCalibratedHue:0.0 saturation:0.0 brightness:0.0 alpha:1.0];
105+
if (osxMode == nil) {
106+
value = [NSColor colorWithCalibratedHue:0.0 saturation:0.0 brightness:0.0 alpha:1.0]; //Light mode
107+
} else {
108+
value = [NSColor colorWithCalibratedHue:0.0 saturation:0.0 brightness:1.0 alpha:1.0]; //Dark mode
109+
}
104110
break;
105111

106112
case WCAccountColorRed:
@@ -116,11 +122,19 @@ + (NSColor *)colorForColor:(WCAccountColor)color idleTint:(BOOL)idleTint {
116122
break;
117123

118124
case WCAccountColorBlue:
119-
value = [NSColor blueColor];
125+
if (osxMode == nil) {
126+
value = [NSColor blueColor]; //Light mode
127+
} else {
128+
value = [NSColor colorWithCalibratedRed:0.5 green:0.5 blue:1.0 alpha:1.0]; //Dark mode
129+
}
120130
break;
121131

122132
case WCAccountColorPurple:
123-
value = [NSColor purpleColor];
133+
if (osxMode == nil) {
134+
value = [NSColor purpleColor]; //Light mode
135+
} else {
136+
value = [NSColor colorWithCalibratedRed:248.0/255.0 green:91.0/255 blue:228.0/255.0 alpha:1.0]; //Dark mode
137+
}
124138
break;
125139
}
126140

@@ -257,9 +271,16 @@ - (NSImage *)icon {
257271

258272

259273
- (NSImage *)iconWithIdleTint:(BOOL)value {
260-
return _idle && value
261-
? [_icon tintedImageWithColor:[NSColor colorWithDeviceWhite:1.0 alpha:0.5]]
262-
: _icon;
274+
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
275+
if (osxMode == nil) {
276+
return _idle && value
277+
? [_icon tintedImageWithColor:[NSColor colorWithDeviceWhite:1.0 alpha:0.5]]
278+
: _icon; //Light mode
279+
} else {
280+
return _idle && value
281+
? [_icon tintedImageWithColor:[NSColor colorWithDeviceWhite:0.0 alpha:0.5]]
282+
: _icon; //Dark mode
283+
}
263284
}
264285

265286

0 commit comments

Comments
 (0)