X-Git-Url: https://git.saurik.com/fiveicondock.git/blobdiff_plain/bddf654d370c44f9883520beed7c05453435a139..8021a3ca83e694e9d1fc3725ca3db5dd52c9b174:/Tweak.mm diff --git a/Tweak.mm b/Tweak.mm index 8581f2b..8e6a74d 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -5,6 +5,7 @@ #import #import #import +#import MSHook(float, SBButtonBar$leftMarginForIconRowArray$, SBButtonBar *self, SEL sel, NSArray *row) { return [row indexOfObject:[NSNull null]] == NSNotFound ? 4 : _SBButtonBar$leftMarginForIconRowArray$(self, sel, row); @@ -64,13 +65,21 @@ MSHook(CGPoint, SBButtonBar$originForIconAtX$Y$, SBButtonBar *self, SEL sel, int return origin; } +static int $SBIconModel$maxIconListCount(SBIconModel *self, SEL sel) { + return 16; +} + extern "C" void TweakInitialize() { Class $SBButtonBar(objc_getClass("SBButtonBar")); - _SBButtonBar$leftMarginForIconRowArray$ = MSHookMessage($SBButtonBar, @selector(leftMarginForIconRowArray:), &$SBButtonBar$leftMarginForIconRowArray$); + MSHookMessage($SBButtonBar, @selector(leftMarginForIconRowArray:), MSHake(SBButtonBar$leftMarginForIconRowArray$)); MSHookMessage($SBButtonBar, @selector(maxIconColumns), &$SBButtonBar$maxIconColumns); MSHookMessage($SBButtonBar, @selector(topIconPadding), &$SBButtonBar$topIconPadding); - _SBButtonBar$originForIconAtX$Y$ = MSHookMessage($SBButtonBar, @selector(originForIconAtX:Y:), &$SBButtonBar$originForIconAtX$Y$); + MSHookMessage($SBButtonBar, @selector(originForIconAtX:Y:), MSHake(SBButtonBar$originForIconAtX$Y$)); Class $SBIcon(objc_getClass("SBIcon")); - _SBIcon$setOrigin$ = MSHookMessage($SBIcon, @selector(setOrigin:), &$SBIcon$setOrigin$); + MSHookMessage($SBIcon, @selector(setOrigin:), MSHake(SBIcon$setOrigin$)); + + Class $SBIconModel(objc_getClass("SBIconModel")); + Class $$SBIconModel(object_getClass($SBIconModel)); + MSHookMessage($$SBIconModel, @selector(maxIconListCount), &$SBIconModel$maxIconListCount); }