Tweak to change opacity of dock. Includes experimental “classic” dock setting for botched devices. I intend to make this a more full fledged dock-customization tweak in the future.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3KB

  1. %hook SBDockView
  2. -(void)setBackgroundAlpha:(double)arg1 { // Method found in SBDockView.h used to set dock opacity
  3. // Preferences
  4. NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults]persistentDomainForName:@"com.exoticswingset.truthfuldockprefs"];
  5. id isTweakEnabled = [bundleDefaults valueForKey:@"isTweakEnabled"];
  6. double alphaValue = [[bundleDefaults valueForKey:@"alphaValue"]doubleValue];
  7. if ([isTweakEnabled isEqual:@0]) { // Checks if tweak is disabled
  8. %orig;
  9. } else {
  10. %orig(alphaValue); // %orig executes all of the other code that originally would have ran, but inside the parentheses is where arg1, a double is passed through instead of the default.
  11. }
  12. }
  13. -(BOOL)isDockInset { // BOOL found in SBDockView.h. If set to NO, dock no longer appears round on notched iPhones.
  14. // Preferences
  15. NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults]persistentDomainForName:@"com.exoticswingset.truthfuldockprefs"];
  16. id isTweakEnabled = [bundleDefaults valueForKey:@"isTweakEnabled"];
  17. id classicDockEnabled = [bundleDefaults valueForKey:@"classicDockEnabled"];
  18. if ([isTweakEnabled isEqual:@0]) {
  19. return %orig;
  20. } else if ([classicDockEnabled isEqual:@0]) {
  21. return %orig;
  22. } else {
  23. return NO;
  24. }
  25. }
  26. %end