Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Commit

Permalink
[prefs] add workaround for notifications vc tint color derping out
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Jun 18, 2017
1 parent 1fa0925 commit aa21f3c
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions prefs/HBCZRootListController.x
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,38 @@
[overscrollView addSubview:hiLabel];
}

#pragma mark - PSListController

- (void)reloadSpecifiers {
[super reloadSpecifiers];
[self _setUpSpecifiers];
}

- (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {
[super setPreferenceValue:value specifier:specifier];

// if the typestatus plus specifier has been toggled, update the enabled/disabled state of the
// notification specifiers
if ([specifier.identifier isEqualToString:@"TypeStatusPlus"]) {
[self _setUpSpecifiers];
}
}

- (void)showController:(PSViewController *)controller animate:(BOOL)animated {
// remove the tint from the notifications vc, because it derps out the alert style section
if ([controller isKindOfClass:%c(BulletinBoardAppDetailController)]) {
HBAppearanceSettings *appearanceSettings = [self.hb_appearanceSettings copy];
appearanceSettings.tintColor = nil;
((PSListController *)controller).hb_appearanceSettings = appearanceSettings;

[UISwitch appearanceWhenContainedInInstancesOfClasses:@[ controller.class ]].onTintColor = self.hb_appearanceSettings.tintColor;
}

[super showController:controller animate:animated];
}

#pragma mark - Setup

- (void)_setUpSpecifiers {
// grab the typestatus plus bundle
// NSBundle *plusBundle = [NSBundle bundleWithPath:@"/Library/PreferenceBundles/TypeStatusPlus.bundle"];
Expand Down Expand Up @@ -122,14 +149,4 @@
}
}

- (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {
[super setPreferenceValue:value specifier:specifier];

// if the typestatus plus specifier has been toggled, update the enabled/disabled state of the
// notification specifiers
if ([specifier.identifier isEqualToString:@"TypeStatusPlus"]) {
[self _setUpSpecifiers];
}
}

@end

0 comments on commit aa21f3c

Please sign in to comment.