]> git.saurik.com Git - winterboard.git/commitdiff
Added Icon Alpha and fixed offset bug.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 17 Mar 2009 19:20:21 +0000 (19:20 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 17 Mar 2009 19:20:21 +0000 (19:20 +0000)
Dim Icons.theme/Info.plist [new file with mode: 0644]
Library.mm
control

diff --git a/Dim Icons.theme/Info.plist b/Dim Icons.theme/Info.plist
new file mode 100644 (file)
index 0000000..9069a2f
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0"><dict>
+
+<key>IconAlpha</key>
+<string>0.5</string>
+
+</dict></plist>
index 406e4cb323e6c16ff8eeb0119c94cf0438952fbf..95dc7ff1891b3e5d8bb4e92b36b746deb68ae223 100644 (file)
@@ -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<id>(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 07221c0a87335601ca7b595b10321d3962d521d7..7594ba488adb2fcb6011b6e2b1e12390a36448e6 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 Section: System
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 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)