1
0
mirror of https://github.com/Burrit0z/kai synced 2025-07-04 14:56:48 +00:00

light dark

This commit is contained in:
Burrit0z
2020-05-26 14:33:26 -04:00
parent 882867fee6
commit 90235fe2ca
6 changed files with 156 additions and 191 deletions

View File

@ -37,7 +37,11 @@
} else if(hideDeviceLabel) {
[self.label setFont:[UIFont systemFontOfSize:0]];
}
[self.label setTextColor:[UIColor whiteColor]];
if(textColor==1) {
[self.label setTextColor:[UIColor whiteColor]];
} else {
[self.label setTextColor:[UIColor blackColor]];
}
self.label.lineBreakMode = NSLineBreakByWordWrapping;
self.label.numberOfLines = 1;
[self.label setText:labelText];
@ -51,7 +55,11 @@
} else {
[self.percentLabel setFont:[UIFont systemFontOfSize:14]];
}
[self.percentLabel setTextColor:[UIColor whiteColor]];
if(textColor==1) {
[self.percentLabel setTextColor:[UIColor whiteColor]];
} else {
[self.percentLabel setTextColor:[UIColor blackColor]];
}
self.percentLabel.lineBreakMode = NSLineBreakByWordWrapping;
[self.percentLabel setTextAlignment:NSTextAlignmentRight];
self.percentLabel.numberOfLines = 1;
@ -116,6 +124,21 @@
return self;
}
-(void)traitCollectionDidChange:(id)arg1 {
[super traitCollectionDidChange:arg1];
if(textColor==0) {
if(@available(iOS 12.0, *)) {
if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
[self.label setTextColor:[UIColor whiteColor]];
[self.percentLabel setTextColor:[UIColor whiteColor]];
} else if(self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
[self.label setTextColor:[UIColor blackColor]];
[self.percentLabel setTextColor:[UIColor blackColor]];
}
}
}
}
-(void)updateInfo {
//NSLog(@"kai: updating cell info");