From a3dba89ffcf041716dd891eb1f2a5b06e7584c98 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 10 Jan 2014 03:54:29 -0800 Subject: [PATCH] Fix the separation of Docked/Undocked icon labels. --- Library.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Library.mm b/Library.mm index b3eb56c..42fd396 100644 --- a/Library.mm +++ b/Library.mm @@ -1784,6 +1784,15 @@ MSClassMessage2(id, SBIconView, _labelImageParametersForIcon,location, id, icon, } return nil; } +MSInstanceMessage0(id, SBIconView, _labelImageParameters) { + if (id parameters = MSOldCall()) { + int &location(MSHookIvar(self, "_iconLocation")); + if (&location != NULL) + $objc_setAssociatedObject(parameters, @selector(wb$inDock), [NSNumber numberWithBool:(location == 3)], OBJC_ASSOCIATION_RETAIN_NONATOMIC); + return parameters; + } return nil; +} + MSClassMessage1(UIImage *, SBIconLabelImage, _drawLabelImageForParameters, id, parameters) { bool docked(wb$inDock(parameters)); @@ -2140,6 +2149,7 @@ static void SBInitialize() { } else { WBRename(SBIconLabelImageParameters, hash, hash); WBRename($SBIconView, _labelImageParametersForIcon:location:, _labelImageParametersForIcon$location$); + WBRename(SBIconView, _labelImageParameters, _labelImageParameters); WBRename($SBIconLabelImage, _drawLabelImageForParameters:, _drawLabelImageForParameters$); } -- 2.45.2