mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[ios] Always create light mode categories icons for the system search
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
9c70433007
commit
73a3d1850b
@@ -44,11 +44,12 @@
|
|||||||
|
|
||||||
NSString * categoryKeyString = @(categoryKey.c_str());
|
NSString * categoryKeyString = @(categoryKey.c_str());
|
||||||
NSString * imageName = [NSString stringWithFormat:@"Search/Categories/%@", [categoryKeyString stringByReplacingOccurrencesOfString: @"category_" withString:@""]];
|
NSString * imageName = [NSString stringWithFormat:@"Search/Categories/%@", [categoryKeyString stringByReplacingOccurrencesOfString: @"category_" withString:@""]];
|
||||||
|
UIImage * image = [UIImage imageNamed:imageName inBundle:nil compatibleWithTraitCollection:[UITraitCollection traitCollectionWithUserInterfaceStyle: UIUserInterfaceStyleLight]];
|
||||||
UIGraphicsBeginImageContext(CGSizeMake(360, 360));
|
UIGraphicsBeginImageContext(CGSizeMake(360, 360));
|
||||||
[[UIImage imageNamed:imageName] drawInRect:CGRectMake(0, 0, 360, 360)];
|
[image drawInRect:CGRectMake(0, 0, 360, 360)];
|
||||||
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
|
UIImage * resizedImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
UIGraphicsEndImageContext() ;
|
UIGraphicsEndImageContext() ;
|
||||||
attrSet.thumbnailData = UIImagePNGRepresentation(image);
|
attrSet.thumbnailData = UIImagePNGRepresentation(resizedImage);
|
||||||
|
|
||||||
CSSearchableItem * item =
|
CSSearchableItem * item =
|
||||||
[[CSSearchableItem alloc] initWithUniqueIdentifier:categoryKeyString
|
[[CSSearchableItem alloc] initWithUniqueIdentifier:categoryKeyString
|
||||||
|
|||||||
Reference in New Issue
Block a user