From: Jay Freeman (saurik) Date: Mon, 4 Jun 2012 11:11:39 +0000 (+0000) Subject: Per-page wallpaper alignment was broken until jitter. X-Git-Tag: v0.9.3906~12 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/af22086e643ffc516d8753facfe6c660ec0b63e8 Per-page wallpaper alignment was broken until jitter. --- diff --git a/Library.mm b/Library.mm index f716b30..80001b2 100644 --- a/Library.mm +++ b/Library.mm @@ -1534,11 +1534,20 @@ MSHook(void, SBStatusBarTimeView$drawRect$, SBStatusBarTimeView *self, SEL sel, @end -MSHook(void, SBIconList$setFrame$, SBIconList *self, SEL sel, CGRect frame) { +static void SBIconList$updateFrames$(SBIconList *self) { NSArray *subviews([self subviews]); WBImageView *view([subviews count] == 0 ? nil : [subviews objectAtIndex:0]); if (view != nil && [view wb$isWBImageView]) [view wb$updateFrame]; +} + +MSHook(void, SBIconList$didMoveToSuperview, SBIconList *self, SEL sel) { + SBIconList$updateFrames$(self); + _SBIconList$didMoveToSuperview(self, sel); +} + +MSHook(void, SBIconList$setFrame$, SBIconList *self, SEL sel, CGRect frame) { + SBIconList$updateFrames$(self); _SBIconList$setFrame$(self, sel, frame); } @@ -2014,6 +2023,7 @@ static void SBInitialize() { WBRename(SBIconLabel, initWithSize:label:, initWithSize$label$); WBRename(SBIconLabel, setInDock:, setInDock$); + WBRename(SBIconList, didMoveToSuperview, didMoveToSuperview); WBRename(SBIconList, setFrame:, setFrame$); WBRename(SBIconModel, cacheImageForIcon:, cacheImageForIcon$);