Dark tabs for Zenith! Mirror of https://github.com/mac-user669/ZenithDark
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

37 lines
1.7KB

  1. // Basically all of this was written by J.K. Hayslip, aka iKilledAppl3. He's a huge help, go follow him on twitter.
  2. // Idea by Cooper Hull, aka mac-user669. Thanks to iKA for the help!
  3. //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––\\
  4. // We make an interface to let Theos know that ZNGrabberAccessoryView is of type UIImageView;
  5. @interface ZNGrabberAccessoryView : UIImageView
  6. @end
  7. // We then import UIKit so we can override the color property without this Theos doesn't have a clue what those properties are.
  8. @import UIKit;
  9. //We then hook the class in this case Zenith's grabber view is called “ZNGrabberAccessoryView”
  10. %hook ZNGrabberAccessoryView
  11. // The method we then modify is this method that is called from UIImageView to set the backgroundColor of the image view.
  12. // Since the grabber view is of type UIImageView we can modify this method :)
  13. -(void)setBackgroundColor:(UIColor *)backgroundColor {
  14. //Call the original function then pass our custom argument to the backgroundColor argument as shown below.
  15. %orig([UIColor colorWithWhite:0.0 alpha:0.44]);
  16. }
  17. // We need to make sure we tell theos that we are finished hooking this class not doing so with cause the end of the world :P
  18. %end
  19. // Our constructor
  20. %ctor {
  21. // We use this to make sure we load Zenith's dynamic library at runtime so we can modify it with our tweak.
  22. dlopen ("/Library/MobileSubstrate/DynamicLibraries/Zenith.dylib", RTLD_NOW);
  23. }