From de17ba7ca111f07650f41db4a2e1ff0562e36c15 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 3 Nov 2015 11:03:48 -0700 Subject: [PATCH 1/3] Removed redundant a labelView hidden This could issues where that other tweaks may use this and since you dont check if your tweak is enabled this is hell of bad practice.... --- SBIconView.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/SBIconView.m b/SBIconView.m index ac594dd..f6df403 100644 --- a/SBIconView.m +++ b/SBIconView.m @@ -336,8 +336,6 @@ - (void)layoutSubviews { if ([self isInDock]) { MSHookIvar(self, "_labelView").hidden = true; - }else{ - MSHookIvar(self, "_labelView").hidden = false; } } From 3b7eaa3257fec216d50ca3ac79b746191ad4f0f3 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 9 Nov 2015 14:09:37 -0700 Subject: [PATCH 2/3] Update 2 What about this. This pretty much moves the if statement from the bottom to the top and then also checks to make sure the tweak is enabled. --- SBIconView.m | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SBIconView.m b/SBIconView.m index f6df403..294b325 100644 --- a/SBIconView.m +++ b/SBIconView.m @@ -326,17 +326,18 @@ - (void)updateIndicatorVisibility { - (void)layoutSubviews { if (![[prefs getenabled] boolValue]) { %orig(); - MSHookIvar(self, "_labelView").hidden = false; + if ([self isInDock]) { + MSHookIvar(self, "_labelView").hidden = true; + } + else { + MSHookIvar(self, "_labelView").hidden = false; + } self.indicatorView.hidden = true; return; } %orig(); [self updateIndicatorVisibility]; - - if ([self isInDock]) { - MSHookIvar(self, "_labelView").hidden = true; - } } #pragma mark Touch Handling From bd74229ab747757108a68e3949106284bd78eefe Mon Sep 17 00:00:00 2001 From: wizage Date: Sun, 15 Nov 2015 02:52:36 -0800 Subject: [PATCH 3/3] Adding support to label notify This will add support for label notify. I tested it extensively unlike the other pull requests. --- SBIconView.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SBIconView.m b/SBIconView.m index 294b325..e1a775d 100644 --- a/SBIconView.m +++ b/SBIconView.m @@ -323,9 +323,8 @@ - (void)updateIndicatorVisibility { } -- (void)layoutSubviews { - if (![[prefs getenabled] boolValue]) { - %orig(); +- (void) _updateLabel { + if ([[prefs getenabled] boolValue]) { if ([self isInDock]) { MSHookIvar(self, "_labelView").hidden = true; } @@ -333,9 +332,15 @@ - (void)layoutSubviews { MSHookIvar(self, "_labelView").hidden = false; } self.indicatorView.hidden = true; + %orig(); return; } + else{ + %orig(); + } +} +- (void)layoutSubviews { %orig(); [self updateIndicatorVisibility]; }