From: Jay Freeman (saurik) Date: Sun, 3 Aug 2008 12:49:04 +0000 (+0000) Subject: Fixed some visual artifacts on themes (transparency). X-Git-Tag: v0.9.3900~89 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/08454e3a0ad71f6e613171e9e6689dc48e18f15f?hp=2435118f6fc7577432f004087aeed17ee0bc4c20 Fixed some visual artifacts on themes (transparency). --- diff --git a/Library.mm b/Library.mm index 194a6d2..ebc0140 100644 --- a/Library.mm +++ b/Library.mm @@ -62,6 +62,8 @@ extern "C" { #import #import #import +#import +#import #import #import @@ -131,6 +133,8 @@ void WBRename(const char *classname, const char *oldname, IMP newimp) { @protocol WinterBoard - (NSString *) wb_pathForIcon; - (NSString *) wb_pathForResource:(NSString *)resource ofType:(NSString *)type; +- (id) wb_init; +- (id) wb_layer; - (id) wb_initWithSize:(CGSize)size; - (id) wb_initWithFrame:(CGRect)frame; - (id) wb_initWithCoder:(NSCoder *)coder; @@ -139,6 +143,8 @@ void WBRename(const char *classname, const char *oldname, IMP newimp) { - (void) wb_setAlpha:(float)value; - (void) wb_setBarStyle:(int)style; - (id) wb_initWithFrame:(CGRect)frame withBarStyle:(int)style withTintColor:(UIColor *)color; +- (void) wb_setOpaque:(BOOL)opaque; +- (void) wb_didMoveToSuperview; @end NSMutableDictionary **ImageMap_; @@ -197,12 +203,25 @@ NSString *NSBundle$pathForResource$ofType$(NSBundle *self, SEL sel, return [self wb_pathForResource:resource ofType:type]; } -void SBAppWindow$setBackgroundColor$(SBAppWindow *self, SEL sel, UIColor *color) { +void $setBackgroundColor$(id self, SEL sel, UIColor *color) { if (Wallpaper_ != nil) return [self wb_setBackgroundColor:[UIColor clearColor]]; return [self wb_setBackgroundColor:color]; } +/*id SBStatusBarContentsView$initWithFrame$(SBStatusBarContentsView *self, SEL sel, CGRect frame) { + self = [self wb_initWithFrame:frame]; + if (self == nil) + return nil; + + NSString *path = [NSString stringWithFormat:@"%@/StatusBar.png", theme_]; + if ([Manager_ fileExistsAtPath:path]) + [self addSubview:[[[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:path]] autorelease]]; + //[self setBackgroundColor:[UIColor clearColor]]; + + return self; +}*/ + bool UINavigationBar$setBarStyle$_(SBAppWindow *self) { if (Info_ != nil) { NSNumber *number = [Info_ objectForKey:@"NavigationBarStyle"]; @@ -253,23 +272,21 @@ void UINavigationBar$setBarStyle$(SBAppWindow *self, SEL sel, int s return [self wb_setBarStyle:style]; } -/*id SBButtonBar$initWithFrame$(SBButtonBar *self, SEL sel, CGRect frame) { - self = [self wb_initWithFrame:frame]; - if (self == nil) - return nil; - if (Wallpaper_ != nil) - [self setBackgroundColor:[UIColor clearColor]]; - return self; -}*/ +void $didMoveToSuperview(SBButtonBar *self, SEL sel) { + [[self superview] setBackgroundColor:[UIColor clearColor]]; + [self wb_didMoveToSuperview]; +} id SBContentLayer$initWithSize$(SBContentLayer *self, SEL sel, CGSize size) { self = [self wb_initWithSize:size]; if (self == nil) return nil; - if (Wallpaper_ != nil) + if (Wallpaper_ != nil) { if (UIImage *image = [[UIImage alloc] initWithContentsOfFile:Wallpaper_]) [self addSubview:[[[UIImageView alloc] initWithImage:image] autorelease]]; + [self setBackgroundColor:[UIColor redColor]]; + } return self; } @@ -305,14 +322,18 @@ extern "C" void WBInitialize() { Manager_ = [[NSFileManager defaultManager] retain]; - WBRename("SBApplication", "pathForIcon", (IMP) &SBApplication$pathForIcon); - WBRename("NSBundle", "pathForResource:ofType:", (IMP) &NSBundle$pathForResource$ofType$); - WBRename("SBAppWindow", "setBackgroundColor:", (IMP) &SBAppWindow$setBackgroundColor$); - WBRename("SBContentLayer", "initWithSize:", (IMP) &SBContentLayer$initWithSize$); + //WBRename("SBStatusBarContentsView", "setBackgroundColor:", (IMP) &$setBackgroundColor$); //WBRename("UINavigationBar", "initWithFrame:", (IMP) &UINavigationBar$initWithFrame$); //WBRename("UINavigationBar", "initWithCoder:", (IMP) &UINavigationBar$initWithCoder$); WBRename("UINavigationBar", "setBarStyle:", (IMP) &UINavigationBar$setBarStyle$); //WBRename("UINavigationBarBackground", "initWithFrame:withBarStyle:withTintColor:", (IMP) &UINavigationBarBackground$initWithFrame$withBarStyle$withTintColor$); + //WBRename("SBStatusBarContentsView", "initWithFrame:", (IMP) &SBStatusBarContentsView$initWithFrame$); + + WBRename("SBApplication", "pathForIcon", (IMP) &SBApplication$pathForIcon); + WBRename("NSBundle", "pathForResource:ofType:", (IMP) &NSBundle$pathForResource$ofType$); + WBRename("SBContentLayer", "initWithSize:", (IMP) &SBContentLayer$initWithSize$); + WBRename("SBStatusBarContentsView", "didMoveToSuperview", (IMP) &$didMoveToSuperview); + WBRename("SBButtonBar", "didMoveToSuperview", (IMP) &$didMoveToSuperview); if (NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", NSHomeDirectory()]]) { [settings autorelease]; diff --git a/control b/control index 6d3a9d2..ad24cef 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: Themes Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.2500-1 +Version: 0.9.2501-2 Description: more powerful, open-source SummerBoard This tool lets you apply SummerBoard themes. Themes are taken from /Library/Themes (or, now, the older SummerBoard folder). Right now the tool is /very/ simplistic: I have spent about a day coding it so that we would have some stronger theme support on iPhone 2.x. After you install or uninstall this package you will have to /reboot/ (seriously, REBOOT) your phone to it to take effect. @@ -12,5 +12,7 @@ Description: more powerful, open-source SummerBoard WinterBoard is /much/ more powerful than SummerBoard and lets you theme almost any graphic on the system. You can even easily theme .artwork files without having to hack their contents. Instructions on how this works will be posted soon on the More Information page. Name: WinterBoard Provides: theme-manager +Conflicts: com.modmyifone.winterboardicon +Replaces: com.modmyifone.winterboardicon Author: Jay Freeman (saurik) Homepage: http://cydia.saurik.com/winterboard.html diff --git a/makefile b/makefile index 66ba1fc..4310cb7 100644 --- a/makefile +++ b/makefile @@ -23,6 +23,6 @@ package: cp -a Nature winterboard/Library/Themes/com.saurik.WinterBoard.Nature cp -a control preinst postinst prerm winterboard/DEBIAN cp -a Test.sh icon.png WinterBoard.dylib WinterBoard Info.plist ../pledit/pledit winterboard/Applications/WinterBoard.app - dpkg-deb -b winterboard winterboard_0.9.2500-1_iphoneos-arm.deb + dpkg-deb -b winterboard winterboard_0.9.2501-2_iphoneos-arm.deb .PHONY: all clean package