#import <SpringBoard/SBApplication.h>
#import <SpringBoard/SBApplicationIcon.h>
#import <SpringBoard/SBAppWindow.h>
+#import <SpringBoard/SBAwayView.h>
#import <SpringBoard/SBBookmarkIcon.h>
#import <SpringBoard/SBButtonBar.h>
#import <SpringBoard/SBCalendarIconContentsView.h>
#import <SpringBoard/SBContentLayer.h>
#import <SpringBoard/SBIconController.h>
#import <SpringBoard/SBIconLabel.h>
+#import <SpringBoard/SBIconList.h>
#import <SpringBoard/SBIconModel.h>
-#import <SpringBoard/SBSlidingAlertDisplay.h>
#import <SpringBoard/SBStatusBarContentsView.h>
#import <SpringBoard/SBStatusBarController.h>
#import <SpringBoard/SBStatusBarOperatorNameView.h>
Class $SBApplication;
Class $SBApplicationIcon;
+Class $SBAwayView;
Class $SBBookmarkIcon;
Class $SBButtonBar;
Class $SBCalendarIconContentsView;
Class $SBIconBadge;
Class $SBIconController;
Class $SBIconLabel;
+Class $SBIconList;
Class $SBIconModel;
-Class $SBSlidingAlertDisplay;
Class $SBStatusBarContentsView;
Class $SBStatusBarController;
Class $SBStatusBarOperatorNameView;
return self;
}
-MSHook(void, SBSlidingAlertDisplay$updateDesktopImage$, SBSlidingAlertDisplay *self, SEL sel, UIImage *image) {
+MSHook(void, SBAwayView$updateDesktopImage$, SBAwayView *self, SEL sel, UIImage *image) {
NSString *path = $getTheme$([NSArray arrayWithObject:@"LockBackground.html"]);
UIView *&_backgroundView(MSHookIvar<UIView *>(self, "_backgroundView"));
if (path != nil && _backgroundView != nil)
path = nil;
- _SBSlidingAlertDisplay$updateDesktopImage$(self, sel, image);
+ _SBAwayView$updateDesktopImage$(self, sel, image);
if (path != nil) {
CGRect bounds = [self bounds];
}
@interface UIView (WinterBoard)
-- (bool) wb$isImageView;
+- (bool) wb$isWBImageView;
@end
@implementation UIView (WinterBoard)
-- (bool) wb$isImageView {
+- (bool) wb$isWBImageView {
return false;
}
@end
-@interface UIImageView (WinterBoard)
-- (bool) wb$isImageView;
+@interface WBImageView : UIImageView {
+}
+
+- (bool) wb$isWBImageView;
+- (void) wb$updateFrame;
@end
-@implementation UIImageView (WinterBoard)
+@implementation WBImageView
-- (bool) wb$isImageView {
+- (bool) wb$isWBImageView {
return true;
}
+- (void) wb$updateFrame {
+ CGRect frame([self frame]);
+ frame.origin.y = 0;
+
+ for (UIView *view(self); ; ) {
+ view = [view superview];
+ if (view == nil)
+ break;
+ frame.origin.y -= [view frame].origin.y;
+ }
+
+ [self setFrame:frame];
+}
+
@end
+MSHook(void, SBIconList$setFrame$, SBIconList *self, SEL sel, CGRect frame) {
+ NSArray *subviews([self subviews]);
+ WBImageView *view([subviews count] == 0 ? nil : [subviews objectAtIndex:0]);
+ if (view != nil && [view wb$isWBImageView])
+ [view wb$updateFrame];
+ _SBIconList$setFrame$(self, sel, frame);
+}
+
MSHook(void, SBIconController$noteNumberOfIconListsChanged, SBIconController *self, SEL sel) {
SBIconModel *&_iconModel(MSHookIvar<SBIconModel *>(self, "_iconModel"));
NSArray *lists([_iconModel iconLists]);
if (NSString *path = $getTheme$([NSArray arrayWithObject:[NSString stringWithFormat:@"Page%u.png", i]])) {
SBIconList *list([lists objectAtIndex:i]);
NSArray *subviews([list subviews]);
- UIImageView *view([subviews count] == 0 ? nil : [subviews objectAtIndex:0]);
- if (view == nil || ![view wb$isImageView]) {
- view = [[[UIImageView alloc] init] autorelease];
+
+ WBImageView *view([subviews count] == 0 ? nil : [subviews objectAtIndex:0]);
+ if (view == nil || ![view wb$isWBImageView]) {
+ view = [[[WBImageView alloc] init] autorelease];
[list insertSubview:view atIndex:0];
}
+
UIImage *image([UIImage imageWithContentsOfFile:path]);
[view setImage:image];
+ [view wb$updateFrame];
}
return _SBIconController$noteNumberOfIconListsChanged(self, sel);
$SBApplication = objc_getClass("SBApplication");
$SBApplicationIcon = objc_getClass("SBApplicationIcon");
+ $SBAwayView = objc_getClass("SBAwayView");
$SBBookmarkIcon = objc_getClass("SBBookmarkIcon");
$SBButtonBar = objc_getClass("SBButtonBar");
$SBCalendarIconContentsView = objc_getClass("SBCalendarIconContentsView");
$SBIconBadge = objc_getClass("SBIconBadge");
$SBIconController = objc_getClass("SBIconController");
$SBIconLabel = objc_getClass("SBIconLabel");
+ $SBIconList = objc_getClass("SBIconList");
$SBIconModel = objc_getClass("SBIconModel");
- $SBSlidingAlertDisplay = objc_getClass("SBSlidingAlertDisplay");
$SBStatusBarContentsView = objc_getClass("SBStatusBarContentsView");
$SBStatusBarController = objc_getClass("SBStatusBarController");
$SBStatusBarOperatorNameView = objc_getClass("SBStatusBarOperatorNameView");
WBRename(SBIconLabel, initWithSize:label:, initWithSize$label$);
WBRename(SBIconLabel, setInDock:, setInDock$);
+ WBRename(SBIconList, setFrame:, setFrame$);
+
WBRename(SBIconModel, cacheImageForIcon:, cacheImageForIcon$);
WBRename(SBIconModel, getCachedImagedForIcon:, getCachedImagedForIcon$);
- WBRename(SBSlidingAlertDisplay, updateDesktopImage:, updateDesktopImage$);
+ WBRename(SBAwayView, updateDesktopImage:, updateDesktopImage$);
WBRename(SBStatusBarContentsView, didMoveToSuperview, didMoveToSuperview);
WBRename(SBStatusBarContentsView, initWithStatusBar:mode:, initWithStatusBar$mode$);
WBRename(SBStatusBarController, setStatusBarMode:orientation:duration:fenceID:animation:, setStatusBarMode$orientation$duration$fenceID$animation$);