substrate extension to make the app switcher cards square like the non-x iPhones
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

33 lines
824B

  1. // Define the path to our preference plist
  2. #define PLIST_PATH @"/var/mobile/Library/Preferences/com.yaypixxo.squareswitcherxprefs.plist"
  3. // Create a method we'll use to get the bool value of the enable switch
  4. inline bool GetPrefBool(NSString *key) {
  5. return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
  6. }
  7. // What to modify
  8. @interface SBAppSwitcherPageView : UIView
  9. @property (assign,nonatomic) double cornerRadius;
  10. -(void)_updateCornerRadius;
  11. @end
  12. // Hook into header
  13. %hook SBAppSwitcherPageView
  14. -(void)_updateCornerRadius {
  15. // Check if enable switch is on (using the method we created earlier)
  16. if (GetPrefBool(@"enabled")) {
  17. // Change corner radius
  18. %orig;
  19. self.cornerRadius = 5;
  20. }
  21. // If the enable switch is off, don't modify
  22. else {
  23. %orig;
  24. }
  25. }
  26. // And cleanup
  27. %end