From 1e217c2b51e9776ca3920e8c8dc20e3058f27597 Mon Sep 17 00:00:00 2001 From: wutschel Date: Sat, 18 Dec 2021 13:20:10 +0100 Subject: [PATCH] Beautify the search icon in grid view's index Use the same icon as iOS's index (magnifying glass with transparent circle, handle bar to lower right side). --- .../BDKCollectionIndexView.m | 15 +++++++++++- .../icons/icon_search.imageset/Contents.json | 22 ++++++++++++++++++ .../icon_search.imageset/icon_search.png | Bin 0 -> 1647 bytes .../icon_search.imageset/icon_search@2x.png | Bin 0 -> 1416 bytes 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 XBMC Remote/Images.xcassets/icons/icon_search.imageset/Contents.json create mode 100644 XBMC Remote/Images.xcassets/icons/icon_search.imageset/icon_search.png create mode 100644 XBMC Remote/Images.xcassets/icons/icon_search.imageset/icon_search@2x.png diff --git a/XBMC Remote/BDKCollectionIndexView/BDKCollectionIndexView.m b/XBMC Remote/BDKCollectionIndexView/BDKCollectionIndexView.m index aa5d5fc2d5..f6ee4629b2 100644 --- a/XBMC Remote/BDKCollectionIndexView/BDKCollectionIndexView.m +++ b/XBMC Remote/BDKCollectionIndexView/BDKCollectionIndexView.m @@ -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; diff --git a/XBMC Remote/Images.xcassets/icons/icon_search.imageset/Contents.json b/XBMC Remote/Images.xcassets/icons/icon_search.imageset/Contents.json new file mode 100644 index 0000000000..bdfb532040 --- /dev/null +++ b/XBMC Remote/Images.xcassets/icons/icon_search.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "icon_search.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icon_search@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/XBMC Remote/Images.xcassets/icons/icon_search.imageset/icon_search.png b/XBMC Remote/Images.xcassets/icons/icon_search.imageset/icon_search.png new file mode 100644 index 0000000000000000000000000000000000000000..545e18526ffb9fca2edbf54f5e806847662712ed GIT binary patch literal 1647 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIEa{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBDAAG{;hE;^%b*2hb1<+n z3NbJPS&Tr)z$nE4G7ZRL@M4sPvx68lplX;H7}_%#SfFa6fHVk90Ai3H2+h2J5n8?tx|+G%>LOTY(~q za3DlSBvu{BqUbvOi!xJzfda7uY6G$ux_X2Kp?R4lc1BPwXu?RkK>o7|$gD`siFC=# zP0cF?`Nq`1MjxvLR*ez3G$KhrHQMNd;twf4A&CVn3QR3_TsHdflxN44IrFR#FrBXT zba4#v;GH|wIy)p#q%~d5P059~=@`3N7yprC4L_KV9CH(NS>uw+RHnH_^bf1pxsG4r zAv!G!7Id^mMRX`NDR3xC_;Rrd%Afoit)4!2PIa-dWZL1R{nzgOezWuWy-YJB&8|hA zw_U_Uj>)^eWxZ7V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