├── DietBar.plist ├── .gitignore ├── after.png ├── before.png ├── Icon-small.psd ├── Icon-small@2x.psd ├── README.md ├── Makefile ├── layout ├── Library │ └── PreferenceLoader │ │ └── Preferences │ │ ├── DietBar.png │ │ ├── DietBar@2x.png │ │ └── DietBar.plist └── DEBIAN │ └── control ├── .gitmodules └── Tweak.x /DietBar.plist: -------------------------------------------------------------------------------- 1 | Filter = {Bundles = ("com.apple.UIKit");}; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ._* 2 | *.deb 3 | .debmake 4 | _ 5 | obj 6 | .theos 7 | -------------------------------------------------------------------------------- /after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpetrich/DietBar/HEAD/after.png -------------------------------------------------------------------------------- /before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpetrich/DietBar/HEAD/before.png -------------------------------------------------------------------------------- /Icon-small.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpetrich/DietBar/HEAD/Icon-small.psd -------------------------------------------------------------------------------- /Icon-small@2x.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpetrich/DietBar/HEAD/Icon-small@2x.psd -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Punk to Funk: 2 | ![before](DietBar/raw/master/before.png) ![after](DietBar/raw/master/after.png) -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TWEAK_NAME = DietBar 2 | DietBar_FILES = Tweak.x 3 | 4 | include framework/makefiles/common.mk 5 | include framework/makefiles/tweak.mk 6 | -------------------------------------------------------------------------------- /layout/Library/PreferenceLoader/Preferences/DietBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpetrich/DietBar/HEAD/layout/Library/PreferenceLoader/Preferences/DietBar.png -------------------------------------------------------------------------------- /layout/Library/PreferenceLoader/Preferences/DietBar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpetrich/DietBar/HEAD/layout/Library/PreferenceLoader/Preferences/DietBar@2x.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "framework"] 2 | path = framework 3 | url = git://github.com/rpetrich/theos.git 4 | [submodule "Localization"] 5 | path = Localization 6 | url = git://github.com/rpetrich/Localization.git 7 | -------------------------------------------------------------------------------- /layout/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: com.rpetrich.dietbar 2 | Priority: optional 3 | Section: Tweaks 4 | Architecture: iphoneos-arm 5 | Version: 1.1 6 | Description: Puts navigation bars on a diet! 7 | Name: DietBar 8 | Depends: firmware (>= 3.0), mobilesubstrate, preferenceloader, applist (>= 1.4.3) 9 | Author: Ryan Petrich 10 | Maintainer: BigBoss 11 | Homepage: http://moreinfo.thebigboss.org/moreinfo/depiction.php?file=dietbarData 12 | Depiction: http://moreinfo.thebigboss.org/moreinfo/depiction.php?file=dietbarData 13 | Sponsor: thebigboss.org 14 | Tag: purpose::extension 15 | dev: rpetrich 16 | -------------------------------------------------------------------------------- /layout/Library/PreferenceLoader/Preferences/DietBar.plist: -------------------------------------------------------------------------------- 1 | entry = { 2 | bundle = AppList; 3 | cell = PSLinkCell; 4 | icon = "/Library/PreferenceLoader/Preferences/DietBar.png"; 5 | isController = 1; 6 | label = DietBar; 7 | ALSettingsPath = "/var/mobile/Library/Preferences/com.rpetrich.dietbar.plist"; 8 | ALSettingsKeyPrefix = "DBEnabled-"; 9 | ALChangeNotification = "com.rpetrich.dietbar.settingschanged"; 10 | ALSettingsDefaultValue = 1; 11 | ALSectionDescriptors = ( 12 | { 13 | items = (); 14 | "footer-title" = "Kill app from multitasking switcher and relaunch for settings to take effect."; 15 | }, 16 | { 17 | title = "System Applications"; 18 | predicate = "isSystemApplication = TRUE AND isWebApplication = FALSE"; 19 | "cell-class-name" = "ALSwitchCell"; 20 | "icon-size" = 29; 21 | "suppress-hidden-apps" = 1; 22 | }, 23 | { 24 | title = "User Applications"; 25 | predicate = "isSystemApplication = FALSE AND isWebApplication = FALSE"; 26 | "cell-class-name" = "ALSwitchCell"; 27 | "icon-size" = 29; 28 | "suppress-hidden-apps" = 1; 29 | "footer-title" = "© 2011-12 Ryan Petrich"; 30 | } 31 | ); 32 | }; -------------------------------------------------------------------------------- /Tweak.x: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | %config(generator=internal); 4 | 5 | %hook UINavigationBar 6 | 7 | - (CGSize)defaultSizeForOrientation:(UIInterfaceOrientation)orientation 8 | { 9 | if ([self promptView]) 10 | return %orig; 11 | CGSize size; 12 | size.width = %orig.width; 13 | size.height = 32.0f; 14 | return size; 15 | } 16 | 17 | %end 18 | 19 | %hook UIToolbar 20 | 21 | - (CGSize)defaultSizeForOrientation:(UIInterfaceOrientation)orientation 22 | { 23 | CGSize size; 24 | size.width = %orig.width; 25 | size.height = 32.0f; 26 | return size; 27 | } 28 | 29 | %end 30 | 31 | // Twitter.app tab bar 32 | 33 | %group Twitter 34 | 35 | %hook ABSubTabBar 36 | 37 | - (void)reallySetFrame:(CGRect)frame 38 | { 39 | frame.size.height = 32.0f; 40 | %orig; 41 | } 42 | 43 | %end 44 | 45 | %end 46 | 47 | // Tweetbot tab bar 48 | 49 | %group Tweetbot 50 | 51 | %hook PTHCustomTabBar 52 | 53 | - (void)setFrame:(CGRect)frame 54 | { 55 | frame.size.height = 33.0f; 56 | %orig; 57 | } 58 | 59 | %end 60 | 61 | %end 62 | 63 | // LinkedIn open button 64 | 65 | %group LinkedIn 66 | 67 | %hook NavFooterView 68 | 69 | - (void)setFrame:(CGRect)frame 70 | { 71 | if (frame.origin.y == 44.0f) 72 | frame.origin.y = 32.0f; 73 | %orig; 74 | } 75 | 76 | %end 77 | 78 | %end 79 | 80 | %ctor 81 | { 82 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 83 | NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier; 84 | if (bundleIdentifier) { 85 | NSString *key = [@"DBEnabled-" stringByAppendingString:bundleIdentifier]; 86 | NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.rpetrich.dietbar.plist"]; 87 | id temp = [settings objectForKey:key]; 88 | if (!temp || [temp boolValue]) { 89 | %init; 90 | if ([bundleIdentifier isEqualToString:@"com.atebits.Tweetie2"]) 91 | %init(Twitter); 92 | else if ([bundleIdentifier isEqualToString:@"com.tapbots.Tweetbot"]) 93 | %init(Tweetbot); 94 | else if ([bundleIdentifier isEqualToString:@"com.linkedin.LinkedIn"]) 95 | %init(LinkedIn); 96 | } 97 | } 98 | [pool drain]; 99 | } --------------------------------------------------------------------------------