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.

Tweak.x 1.3KB

5 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
5 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
1234567891011121314151617181920212223242526272829303132
  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