0001-menu-cell-customization-for-VLC.patch 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From a603f51563889b0532e10592dcc087df4ef9e8e9 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
  3. Date: Sat, 10 Aug 2013 20:16:49 +0200
  4. Subject: [PATCH] menu cell: customization for VLC
  5. ---
  6. Demo/GHMenuCell.h | 2 ++
  7. Demo/GHMenuCell.m | 22 +++++++++++++---------
  8. 2 files changed, 15 insertions(+), 9 deletions(-)
  9. diff --git a/Demo/GHMenuCell.h b/Demo/GHMenuCell.h
  10. index dab09c8..e4c1df7 100644
  11. --- a/Demo/GHMenuCell.h
  12. +++ b/Demo/GHMenuCell.h
  13. @@ -12,4 +12,6 @@ extern NSString const *kSidebarCellImageKey;
  14. @interface GHMenuCell : UITableViewCell
  15. +@property (nonatomic, strong) UIImageView *titleImageView;
  16. +
  17. @end
  18. diff --git a/Demo/GHMenuCell.m b/Demo/GHMenuCell.m
  19. index 1559b86..1a5d20e 100644
  20. --- a/Demo/GHMenuCell.m
  21. +++ b/Demo/GHMenuCell.m
  22. @@ -21,27 +21,30 @@ NSString const *kSidebarCellImageKey = @"CellImage";
  23. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  24. if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
  25. self.clipsToBounds = YES;
  26. -
  27. +
  28. UIView *bgView = [[UIView alloc] init];
  29. bgView.backgroundColor = [UIColor colorWithRed:(38.0f/255.0f) green:(44.0f/255.0f) blue:(58.0f/255.0f) alpha:1.0f];
  30. self.selectedBackgroundView = bgView;
  31. -
  32. +
  33. self.imageView.contentMode = UIViewContentModeCenter;
  34. -
  35. + self.titleImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 260.0f, 50.0f)];
  36. + self.titleImageView.contentMode = UIViewContentModeCenter;
  37. + [self.textLabel.superview addSubview:self.titleImageView];
  38. +
  39. self.textLabel.font = [UIFont fontWithName:@"Helvetica" size:([UIFont systemFontSize] * 1.2f)];
  40. self.textLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
  41. self.textLabel.shadowColor = [UIColor colorWithWhite:0.0f alpha:0.25f];
  42. self.textLabel.textColor = [UIColor colorWithRed:(196.0f/255.0f) green:(204.0f/255.0f) blue:(218.0f/255.0f) alpha:1.0f];
  43. -
  44. +
  45. UIView *topLine = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.height, 1.0f)];
  46. topLine.backgroundColor = [UIColor colorWithRed:(54.0f/255.0f) green:(61.0f/255.0f) blue:(76.0f/255.0f) alpha:1.0f];
  47. [self.textLabel.superview addSubview:topLine];
  48. -
  49. +
  50. UIView *topLine2 = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 1.0f, [UIScreen mainScreen].bounds.size.height, 1.0f)];
  51. topLine2.backgroundColor = [UIColor colorWithRed:(54.0f/255.0f) green:(61.0f/255.0f) blue:(77.0f/255.0f) alpha:1.0f];
  52. [self.textLabel.superview addSubview:topLine2];
  53. -
  54. - UIView *bottomLine = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 43.0f, [UIScreen mainScreen].bounds.size.height, 1.0f)];
  55. +
  56. + UIView *bottomLine = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 50.0f, [UIScreen mainScreen].bounds.size.height, 1.0f)];
  57. bottomLine.backgroundColor = [UIColor colorWithRed:(40.0f/255.0f) green:(47.0f/255.0f) blue:(61.0f/255.0f) alpha:1.0f];
  58. [self.textLabel.superview addSubview:bottomLine];
  59. }
  60. @@ -51,8 +54,9 @@ NSString const *kSidebarCellImageKey = @"CellImage";
  61. #pragma mark UIView
  62. - (void)layoutSubviews {
  63. [super layoutSubviews];
  64. - self.textLabel.frame = CGRectMake(50.0f, 0.0f, 200.0f, 43.0f);
  65. - self.imageView.frame = CGRectMake(0.0f, 0.0f, 50.0f, 43.0f);
  66. + self.textLabel.frame = CGRectMake(50.0f, 0.0f, 200.0f, 50.0f);
  67. + self.titleImageView.frame = CGRectMake(0.0f, 0.0f, 260.0f, 50.0f);
  68. + self.imageView.frame = CGRectMake(0.0f, 0.0f, 50.0f, 50.0f);
  69. }
  70. @end
  71. --
  72. 1.8.3.1 (Apple Git-46)