Browse Source

hide folder badges (probably not the best way to do it)

tags/v1.0.0
Viggo Lekdorf 4 years ago
parent
commit
33801c5f0f
2 changed files with 37 additions and 3 deletions
  1. +21
    -1
      Tweak.x
  2. +16
    -2
      kageprefs/Resources/Root.plist

+ 21
- 1
Tweak.x View File

static BOOL hideLSBatt; static BOOL hideLSBatt;
static BOOL statusBarShowTimeLS; static BOOL statusBarShowTimeLS;
static BOOL hideLabels; static BOOL hideLabels;
static BOOL hideFolderBadges;


static void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { static void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
NSNumber *eEnabled = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enabled" inDomain:nsDomainString]; NSNumber *eEnabled = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enabled" inDomain:nsDomainString];
NSNumber *eHideLSBatt = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideLSBatt" inDomain:nsDomainString]; NSNumber *eHideLSBatt = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideLSBatt" inDomain:nsDomainString];
NSNumber *eStatusBarShowTimeLS = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"statusBarShowTimeLS" inDomain:nsDomainString]; NSNumber *eStatusBarShowTimeLS = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"statusBarShowTimeLS" inDomain:nsDomainString];
NSNumber *eHideLabels = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideLabels" inDomain:nsDomainString]; NSNumber *eHideLabels = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideLabels" inDomain:nsDomainString];
NSNumber *eHideFolderBadges = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideFolderBadges" inDomain:nsDomainString];


enabled = (eEnabled) ? [eEnabled boolValue]:NO; enabled = (eEnabled) ? [eEnabled boolValue]:NO;
hideQuickActionsBG = (eHideQuickActionsBG) ? [eHideQuickActionsBG boolValue]:NO; hideQuickActionsBG = (eHideQuickActionsBG) ? [eHideQuickActionsBG boolValue]:NO;
hideLSBatt = (eHideLSBatt) ? [eHideLSBatt boolValue]:NO; hideLSBatt = (eHideLSBatt) ? [eHideLSBatt boolValue]:NO;
statusBarShowTimeLS = (eStatusBarShowTimeLS) ? [eStatusBarShowTimeLS boolValue]:NO; statusBarShowTimeLS = (eStatusBarShowTimeLS) ? [eStatusBarShowTimeLS boolValue]:NO;
hideLabels = (eHideLabels) ? [eHideLabels boolValue]:NO; hideLabels = (eHideLabels) ? [eHideLabels boolValue]:NO;
hideFolderBadges = (eHideFolderBadges) ? [eHideFolderBadges boolValue]:NO;
} }


// hooks and stuff
// headers and hooks
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>


@interface SBIconView : UIView @interface SBIconView : UIView
-(void)setLabelHidden:(BOOL)hidden; -(void)setLabelHidden:(BOOL)hidden;
@end @end


@interface SBIcon : NSObject
-(id)badgeNumberOrString;
@end

// QUICK ACTIONS BG START // // QUICK ACTIONS BG START //
%hook UICoverSheetButton %hook UICoverSheetButton
-(id)_backgroundEffectsWithBrightness:(double)arg1 { -(id)_backgroundEffectsWithBrightness:(double)arg1 {
%end %end
// QUICK ACTIONS BG END // // QUICK ACTIONS BG END //


// HIDE BADGE TEXT START //
%hook SBIcon
-(id)badgeNumberOrString {
if (enabled && hideFolderBadges) {
return @"";
}
else {
return %orig;
}
}
%end
// HIDE BADGE TEXT END //

// HIDE LABELS START // // HIDE LABELS START //
%hook SBIconView %hook SBIconView
-(void)setLabelHidden:(BOOL)hidden { -(void)setLabelHidden:(BOOL)hidden {

+ 16
- 2
kageprefs/Resources/Root.plist View File

<key>cell</key> <key>cell</key>
<string>PSGroupCell</string> <string>PSGroupCell</string>
<key>footerText</key> <key>footerText</key>
<string></string>
<string>* requires respring</string>
</dict> </dict>
<dict> <dict>
<key>cell</key> <key>cell</key>
<key>PostNotification</key> <key>PostNotification</key>
<string>com.yaypixxo.kage/preferences.changed</string> <string>com.yaypixxo.kage/preferences.changed</string>
</dict> </dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.yaypixxo.kage</string>
<key>key</key>
<string>hideFolderBadges</string>
<key>label</key>
<string>Hide Folder Badges</string>
<key>PostNotification</key>
<string>com.yaypixxo.kage/preferences.changed</string>
</dict>
<dict> <dict>
<key>cell</key> <key>cell</key>
<string>PSGroupCell</string> <string>PSGroupCell</string>
<key>footerText</key> <key>footerText</key>
<string>* requires respring</string>
<string>Kage - By YaYPIXXO</string>
</dict> </dict>
<dict> <dict>
<key>cell</key> <key>cell</key>

Loading…
Cancel
Save