X-Git-Url: https://git.saurik.com/winterboard.git/blobdiff_plain/265e19b2f530586d535744a6636a4e32c0606352..c79980f545109cc1941ef572211890a85b16d9ab:/Library.mm diff --git a/Library.mm b/Library.mm index aa24ab8..a377ae0 100644 --- a/Library.mm +++ b/Library.mm @@ -274,9 +274,13 @@ static NSString *$pathForIcon$(SBApplication *self) { if (![didentifier isEqualToString:identifier]) testForIcon(didentifier); + testForIcon(identifier); testForIcon(dname); + if ([identifier isEqualToString:@"com.apple.MobileSMS"]) + testForIcon(@"SMS"); + if (didentifier != nil) { testForIcon([English_ objectForKey:didentifier]); @@ -288,6 +292,7 @@ static NSString *$pathForIcon$(SBApplication *self) { if (NSString *path = $getTheme$(names)) return path; + return nil; } @@ -587,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]; @@ -613,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); @@ -1542,15 +1556,14 @@ extern "C" void WBInitialize() { NULL, &ChangeWallpaper, (CFStringRef) @"com.saurik.winterboard.lockbackground", NULL, 0 ); - /* - if ($getTheme$([NSArray arrayWithObjects:@"Wallpaper.mp4"]) != nil) { + if ($getTheme$([NSArray arrayWithObject:@"Wallpaper.mp4"]) != nil) { NSBundle *MediaPlayer([NSBundle bundleWithPath:@"/System/Library/Frameworks/MediaPlayer.framework"]); if (MediaPlayer != nil) [MediaPlayer load]; $MPMoviePlayerController = objc_getClass("MPMoviePlayerController"); $MPVideoView = objc_getClass("MPVideoView"); - }*/ + } $WebCoreFrameBridge = objc_getClass("WebCoreFrameBridge"); @@ -1619,7 +1632,9 @@ extern "C" void WBInitialize() { WBRename(SBStatusBarOperatorNameView, setOperatorName:fullSize:, setOperatorName$fullSize$); WBRename(SBStatusBarTimeView, drawRect:, drawRect$); - English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"]; + if (SummerBoard_) + English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"]; + Cache_ = [[NSMutableDictionary alloc] initWithCapacity:64]; }