Browse Source

add option to hide labels

tags/v1.0.0
Viggo Lekdorf 4 years ago
parent
commit
6632be278a
2 changed files with 32 additions and 0 deletions
  1. +18
    -0
      Tweak.x
  2. +14
    -0
      kageprefs/Resources/Root.plist

+ 18
- 0
Tweak.x View File

static BOOL gridSwitcher; static BOOL gridSwitcher;
static BOOL hideLSBatt; static BOOL hideLSBatt;
static BOOL statusBarShowTimeLS; static BOOL statusBarShowTimeLS;
static BOOL hideLabels;


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 *eGridSwitcher = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"gridSwitcher" inDomain:nsDomainString]; NSNumber *eGridSwitcher = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"gridSwitcher" 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];


enabled = (eEnabled) ? [eEnabled boolValue]:NO; enabled = (eEnabled) ? [eEnabled boolValue]:NO;
hideQuickActionsBG = (eHideQuickActionsBG) ? [eHideQuickActionsBG boolValue]:NO; hideQuickActionsBG = (eHideQuickActionsBG) ? [eHideQuickActionsBG boolValue]:NO;
gridSwitcher = (eGridSwitcher) ? [eGridSwitcher boolValue]:NO; gridSwitcher = (eGridSwitcher) ? [eGridSwitcher 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;
} }


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


@interface SBIconView : UIView
-(void)setLabelHidden:(BOOL)hidden;
@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 LABELS START //
%hook SBIconView
-(void)setLabelHidden:(BOOL)hidden {
if (enabled && hideLabels) {
hidden = YES;
}
%orig;
}
%end
// HIDE LABELS END //

// GRID SWITCHER START // // GRID SWITCHER START //
%hook SBAppSwitcherSettings %hook SBAppSwitcherSettings
- (void)setGridSwitcherPageScale:(double)arg1 { - (void)setGridSwitcherPageScale:(double)arg1 {

+ 14
- 0
kageprefs/Resources/Root.plist View File

<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>hideLabels</string>
<key>label</key>
<string>Hide Icon Labels</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>

Loading…
Cancel
Save