The source code, duh.
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.

80 lines
2.3KB

  1. //import needed files/headers
  2. /*#import <SpringBoardHome/SBDockIconListView.h>
  3. #import <SpringBoardHome/SBDockView.h>
  4. #import <SpringBoardHome/SBIconListView.h> */
  5. #import <SpringBoard/SBDockIconListView.h>
  6. #import <SpringBoard/SBDockView.h>
  7. #import <SpringBoard/SBIconListView.h>
  8. #import <SpringBoard/SpringBoard.h>
  9. #import <Cephei/HBPreferences.h>
  10. @interface SBDockView
  11. @end
  12. @interface SBDockIconListView
  13. @end
  14. @interface SBIconListView
  15. @end
  16. //Set up variables for use with Cephei
  17. static BOOL transparent;
  18. static BOOL hidden;
  19. static double setHeight;
  20. static double customOpacity;
  21. static NSInteger setIconNumber;
  22. HBPreferences *preferences;
  23. //hook the dock
  24. %hook SBDockView
  25. //this deals with everything adjusting opacity/transparency
  26. -(void)setBackgroundAlpha:(double)arg1 {
  27. if (transparent == NO && hidden == NO) { //if not transparent and not hidden
  28. %orig(customOpacity);
  29. }else if (transparent || hidden) { // Note: || means or in objc
  30. %orig(0.0); //hides background of the dock (transparent)
  31. } else {
  32. NSLog(@"Dock not Transparent/hidden, no custom opacity\n");
  33. }
  34. }
  35. //ios 12
  36. -(double)dockHeight {
  37. return (%orig*setHeight); //sets custom height if dock is not set to hidden
  38. }
  39. //ios 13
  40. +(double)defaultHeight {
  41. return (%orig*setHeight); //sets custom height if dock is not set to hidden
  42. }
  43. %end
  44. %hook SBDockIconListView
  45. +(NSInteger)maxIcons {
  46. if (hidden) {
  47. return (0);
  48. } else {
  49. return (setIconNumber);
  50. }
  51. }
  52. %end
  53. %ctor {
  54. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  55. [preferences registerDefaults:@{ //defaults for prefernces
  56. @"setHeight": @1,
  57. @"customOpacity": @1,
  58. @"hidden": @NO,
  59. @"setIconNumber": @4,
  60. }];
  61. [preferences registerBool:&transparent default:YES forKey:@"transparent"]; //registering transparent as a Boolean
  62. [preferences registerBool:&hidden default:NO forKey:@"hidden"]; //registering hidden as a Boolean
  63. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"]; //registering setHeigt as a double (number)
  64. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"]; //registering customOpacity as a double (number)
  65. [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"]; //Integer of how many icons to allow
  66. }