From: Jay Freeman (saurik) Date: Tue, 17 Mar 2009 19:20:21 +0000 (+0000) Subject: Added Icon Alpha and fixed offset bug. X-Git-Tag: v0.9.3900~49 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/b0d0c73fd6345e65a2a6e4bfd498371b62e1f15d Added Icon Alpha and fixed offset bug. --- diff --git a/Dim Icons.theme/Info.plist b/Dim Icons.theme/Info.plist new file mode 100644 index 0000000..9069a2f --- /dev/null +++ b/Dim Icons.theme/Info.plist @@ -0,0 +1,8 @@ + + + + +IconAlpha +0.5 + + diff --git a/Library.mm b/Library.mm index 406e4cb..95dc7ff 100644 --- a/Library.mm +++ b/Library.mm @@ -101,6 +101,7 @@ Class $SBBookmarkIcon; Class $SBButtonBar; Class $SBCalendarIconContentsView; Class $SBContentLayer; +Class $SBIcon; Class $SBIconBadge; Class $SBIconController; Class $SBIconLabel; @@ -335,7 +336,7 @@ MSHook(void, SBIconModel$cacheImageForIcon$, SBIconModel *self, SEL sel, SBIcon if (UIImage *image = [icon icon]) { CGSize size = [image size]; - if (size.width > 59 || size.height > 60) { + if (size.width != 59 || size.height != 60) { UIImage *cache($cacheForImage$(image)); [Cache_ setObject:cache forKey:key]; return; @@ -827,6 +828,12 @@ WBDelegate(badge_) @end /* }}} */ +MSHook(void, SBIcon$setAlpha$, SBIcon *self, SEL sel, float alpha) { + if (NSNumber *number = [Info_ objectForKey:@"IconAlpha"]) + alpha = [number floatValue]; + return _SBIcon$setAlpha$(self, sel, alpha); +} + MSHook(id, SBIconBadge$initWithBadge$, SBIconBadge *self, SEL sel, NSString *badge) { if ((self = _SBIconBadge$initWithBadge$(self, sel, badge)) != nil) { id &_badge(MSHookIvar(self, "_badge")); @@ -1309,6 +1316,7 @@ extern "C" void WBInitialize() { $SBButtonBar = objc_getClass("SBButtonBar"); $SBCalendarIconContentsView = objc_getClass("SBCalendarIconContentsView"); $SBContentLayer = objc_getClass("SBContentLayer"); + $SBIcon = objc_getClass("SBIcon"); $SBIconBadge = objc_getClass("SBIconBadge"); $SBIconController = objc_getClass("SBIconController"); $SBIconLabel = objc_getClass("SBIconLabel"); @@ -1329,6 +1337,7 @@ extern "C" void WBInitialize() { WBRename(SBButtonBar, didMoveToSuperview, didMoveToSuperview); WBRename(SBCalendarIconContentsView, drawRect:, drawRect$); WBRename(SBContentLayer, initWithSize:, initWithSize$); + WBRename(SBIcon, setAlpha:, setAlpha$); WBRename(SBIconBadge, initWithBadge:, initWithBadge$); WBRename(SBIconController, noteNumberOfIconListsChanged, noteNumberOfIconListsChanged); WBRename(SBWidgetApplicationIcon, icon, icon); diff --git a/control b/control index 07221c0..7594ba4 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: System Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.2795-1 +Version: 0.9.2796-1 Description: more powerful, open-source SummerBoard Name: WinterBoard Depends: mobilesubstrate (>= 0.9.2660-1)