Toggling system font size shows/hides the feed/story list font size option. Also defaulting to not use system font size.

This commit is contained in:
Samuel Clay 2013-11-23 13:14:30 -08:00
parent 8727b683a5
commit 09a47076d4
3 changed files with 19 additions and 8 deletions

View file

@ -438,12 +438,18 @@
preferencesViewController.showDoneButton = YES; preferencesViewController.showDoneButton = YES;
preferencesViewController.showCreditsFooter = NO; preferencesViewController.showCreditsFooter = NO;
preferencesViewController.title = @"Preferences"; preferencesViewController.title = @"Preferences";
BOOL enabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"offline_allowed"]; NSMutableSet *hiddenSet = [NSMutableSet set];
preferencesViewController.hiddenKeys = enabled ? nil : BOOL offline_enabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"offline_allowed"];
[NSSet setWithObjects:@"offline_image_download", if (offline_enabled) {
@"offline_download_connection", [hiddenSet addObjectsFromArray:@[@"offline_image_download",
@"offline_store_limit", @"offline_download_connection",
nil]; @"offline_store_limit"]];
}
BOOL system_font_enabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"use_system_font_size"];
if (system_font_enabled) {
[hiddenSet addObjectsFromArray:@[@"feed_list_font_size"]];
}
preferencesViewController.hiddenKeys = hiddenSet;
[[NSUserDefaults standardUserDefaults] setObject:@"Delete offline stories..." [[NSUserDefaults standardUserDefaults] setObject:@"Delete offline stories..."
forKey:@"offline_cache_empty_stories"]; forKey:@"offline_cache_empty_stories"];

View file

@ -881,7 +881,12 @@ static UIFont *userLabelFont;
[NSSet setWithObjects:@"instapaper_username", [NSSet setWithObjects:@"instapaper_username",
@"instapaper_password", @"instapaper_password",
nil] animated:YES]; nil] animated:YES];
} } else if ([notification.object isEqual:@"use_system_font_size"]) {
BOOL enabled = (BOOL)[[notification.userInfo objectForKey:@"use_system_font_size"] intValue];
[appDelegate.preferencesViewController setHiddenKeys:!enabled ? nil :
[NSSet setWithObjects:@"feed_list_font_size",
nil] animated:YES];
}
} }
- (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier { - (void)settingsViewController:(IASKAppSettingsViewController*)sender buttonTappedForSpecifier:(IASKSpecifier*)specifier {

View file

@ -84,7 +84,7 @@
<key>Key</key> <key>Key</key>
<string>use_system_font_size</string> <string>use_system_font_size</string>
<key>DefaultValue</key> <key>DefaultValue</key>
<true/> <false/>
</dict> </dict>
<dict> <dict>
<key>Type</key> <key>Type</key>