Skip to content

Commit

Permalink
Beautify the search icon in grid view's index
Browse files Browse the repository at this point in the history
Use the same icon as iOS's index (magnifying glass with transparent circle, handle bar to lower right side).
  • Loading branch information
wutschel committed Dec 18, 2021
1 parent 2ceb07a commit 1e217c2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
15 changes: 14 additions & 1 deletion XBMC Remote/BDKCollectionIndexView/BDKCollectionIndexView.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,21 @@ - (void)buildIndexLabels {
label.font = [UIFont boldSystemFontOfSize:11];
label.minimumScaleFactor = 11.0/11.0;
label.adjustsFontSizeToFitWidth = YES;
if ([indexTitle isEqualToString:@"🔍"]) {
// Use the same icon as iOS's index (magnifying glass with transparent circle)
UIImage *searchImage = [UIImage imageNamed:@"icon_search"];
searchImage = [Utilities colorizeImage:searchImage withColor:UIColor.systemBlueColor];
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, 11)];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
imageView.image = searchImage;
[label addSubview:imageView];
label.textColor = UIColor.clearColor;
}
else {
label.textColor = UIColor.systemBlueColor;
}
label.backgroundColor = UIColor.clearColor;
label.textColor = UIColor.systemBlueColor;
label.shadowColor = UIColor.clearColor;
label.shadowOffset = CGSizeMake(0, 1);
label.textAlignment = NSTextAlignmentCenter;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "icon_search.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1e217c2

Please sign in to comment.