From c79980f545109cc1941ef572211890a85b16d9ab Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 2 May 2010 23:01:43 +0000 Subject: [PATCH] Fixed CalendarIcon text styling when isWildcat. --- Library.mm | 25 +++++++++++++++++-------- control | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Library.mm b/Library.mm index b9399a1..a377ae0 100644 --- a/Library.mm +++ b/Library.mm @@ -592,21 +592,28 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s CFRelease(formatter); - NSString *datestyle(@"" + UIDevice *device([UIDevice currentDevice]); + bool isWild([device respondsToSelector:@selector(isWildcat)] && [device isWildcat]); + + NSString *datestyle([@"" "font-family: Helvetica; " "font-weight: bold; " - "font-size: 39px; " "color: #333333; " "alpha: 1.0; " - ""); + "" stringByAppendingString:(isWild + ? @"font-size: 54px; " + : @"font-size: 39px; " + )]); - NSString *daystyle(@"" + NSString *daystyle([@"" "font-family: Helvetica; " "font-weight: bold; " - "font-size: 9px; " "color: white; " "text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; " - ""); + "" stringByAppendingString:(isWild + ? @"font-size: 11px; " + : @"font-size: 9px; " + )]); if (NSString *style = [Info_ objectForKey:@"CalendarIconDateStyle"]) datestyle = [datestyle stringByAppendingString:style]; @@ -618,14 +625,16 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)]; CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)]; - unsigned base($GSFontGetUseLegacyFontMetrics() ? 71 : 70); + unsigned base(isWild ? 89 : 70); + if ($GSFontGetUseLegacyFontMetrics()) + base = base + 1; [(NSString *)date drawAtPoint:CGPointMake( (width + 1 - datesize.width) / 2, (base - datesize.height) / 2 ) withStyle:datestyle]; [(NSString *)day drawAtPoint:CGPointMake( - (width + 1 - daysize.width) / 2, (16 - daysize.height) / 2 + (width + 1 - daysize.width) / 2, ((isWild ? 18 : 16) - daysize.height) / 2 ) withStyle:daystyle]; CFRelease(date); diff --git a/control b/control index 3d904d0..15e183d 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: System Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.3157-1 +Version: 0.9.3173-1 Description: more powerful, open-source SummerBoard Name: WinterBoard Depends: mobilesubstrate (>= 0.9.2958-1), killall, preferenceloader, libhide (>= 2.0.4), findutils, net.howett.pincrush (>= 0.0.1-23) | pincrush -- 2.45.2