-MSHook(void, SBIconController$appendIconList$, SBIconController *self, SEL sel, SBIconList *list) {
- if (Debug_)
- NSLog(@"appendIconList:%@", list);
- return _SBIconController$appendIconList$(self, sel, list);
+@interface UIView (WinterBoard)
+- (bool) wb$isImageView;
+@end
+
+@implementation UIView (WinterBoard)
+
+- (bool) wb$isImageView {
+ return false;
+}
+
+@end
+
+@interface UIImageView (WinterBoard)
+- (bool) wb$isImageView;
+@end
+
+@implementation UIImageView (WinterBoard)
+
+- (bool) wb$isImageView {
+ return true;
+}
+
+@end
+
+MSHook(void, SBIconController$noteNumberOfIconListsChanged, SBIconController *self, SEL sel) {
+ SBIconModel *&_iconModel(MSHookIvar<SBIconModel *>(self, "_iconModel"));
+ NSArray *lists([_iconModel iconLists]);
+
+ for (unsigned i(0), e([lists count]); i != e; ++i)
+ 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];
+ [list insertSubview:view atIndex:0];
+ }
+ UIImage *image([UIImage imageWithContentsOfFile:path]);
+ [view setImage:image];
+ }
+
+ return _SBIconController$noteNumberOfIconListsChanged(self, sel);