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.
 
 
 
 
 

34 lines
994 B

  1. #import <UIKit/UIKit.h>
  2. #import <Cephei/HBPreferences.h>
  3. static bool enabled = true;
  4. static int prefsCornerRadius = 10;
  5. @interface _UIRootWindow : UIView
  6. @property (setter=_setContinuousCornerRadius:, nonatomic) double _continuousCornerRadius;
  7. - (double)_continuousCornerRadius;
  8. - (void)_setContinuousCornerRadius:(double)arg1;
  9. @end
  10. %hook _UIRootWindow
  11. - (void)layoutSubviews {
  12. %orig;
  13. if (enabled) {
  14. self._continuousCornerRadius = prefsCornerRadius;
  15. self.clipsToBounds = YES;
  16. }
  17. return;
  18. }
  19. %end
  20. void reloadPrefs() {
  21. HBPreferences *file = [[HBPreferences alloc] initWithIdentifier:@"toys.lily.borderprefs"];
  22. enabled = [([file objectForKey:@"enabled"] ?: @(YES)) boolValue];
  23. // prefsCornerRadius = [([file objectForKey:@"borderradius"] ? : @(10)) intValue];
  24. }
  25. %ctor {
  26. reloadPrefs();
  27. CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)reloadPrefs, CFSTR("toys.lily.borderprefs/ReloadPrefs"), NULL, kNilOptions);
  28. }