Bladeren bron

Prefs designing! I really need to look into a color picker now...

master
mac-user669 4 jaren geleden
bovenliggende
commit
cf5a0d7bff
3 gewijzigde bestanden met toevoegingen van 17 en 49 verwijderingen
  1. +2
    -2
      zenithdarkprefs/Resources/Root.plist
  2. +0
    -22
      zenithdarkprefs/ZNDarkPrefsRootListController.h
  3. +15
    -25
      zenithdarkprefs/ZNDarkPrefsRootListController.m

+ 2
- 2
zenithdarkprefs/Resources/Root.plist Bestand weergeven

@@ -49,7 +49,7 @@
<key>cellClass</key>
<string>HBTintedTableCell</string>
<key>action</key>
<string>doAFancyRespring</string>
<string>respringPopUp</string>
</dict>
<dict>
<key>cell</key>
@@ -72,6 +72,6 @@
</dict>
</array>
<key>title</key>
<string>ZenithDark</string>
<string></string>
</dict>
</plist>

+ 0
- 22
zenithdarkprefs/ZNDarkPrefsRootListController.h Bestand weergeven

@@ -14,25 +14,3 @@
@property (nonatomic, strong) UIVisualEffectView *respringEffectView;
@property (nonatomic, strong) UIWindow *mainAppRootWindow;
@end

// we use this to respring our device!
@interface NSTask : NSObject
@property (copy) NSArray *arguments;
@property (copy) NSString *currentDirectoryPath;
@property (copy) NSDictionary *environment;
@property (copy) NSString *launchPath;
@property (readonly) int processIdentifier;
@property (retain) id standardError;
@property (retain) id standardInput;
@property (retain) id standardOutput;
+ (id)currentTaskDictionary;
+ (id)launchedTaskWithDictionary:(id)arg1;
+ (id)launchedTaskWithLaunchPath:(id)arg1 arguments:(id)arg2;
- (id)init;
- (void)interrupt;
- (bool)isRunning;
- (void)launch;
- (bool)resume;
- (bool)suspend;
- (void)terminate;
@end

+ 15
- 25
zenithdarkprefs/ZNDarkPrefsRootListController.m Bestand weergeven

@@ -1,5 +1,7 @@
#import "ZNDarkPrefsRootListController.h"
#import <CepheiPrefs/HBAppearanceSettings.h>
#import <Cephei/HBRespringController.h>
#import <Cephei/HBPreferences.h>

#define THEME_COLOR \
[UIColor colorWithRed:0.82 \
@@ -44,6 +46,7 @@
}
// End of "Hide Large Title"


//share button action
- (void)shareTapped {
@@ -77,40 +80,27 @@
return _specifiers;
}

-(void)respring {
NSTask *task = [[[NSTask alloc] init] autorelease];
[task setLaunchPath:@"/usr/bin/killall"];
[task setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
[task launch];
- (void)respring {
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil]; // Dismisses keyboard
[HBRespringController respringAndReturnTo:[NSURL URLWithString:@"prefs:root=ZenithDark"]];
}

-(void)doAFancyRespring {
-(void)respringPopUp {

UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply Settings?" message:@"This will respring your device." preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"Respring" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply Settings?" message:@"This will respring your device." preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"Respring" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {

// blur then respring our device!
self.mainAppRootWindow = [UIApplication sharedApplication].keyWindow;
self.respringBlur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
self.respringEffectView = [[UIVisualEffectView alloc] initWithEffect:self.respringBlur];
self.respringEffectView.frame = [[UIScreen mainScreen] bounds];
[self.mainAppRootWindow addSubview:self.respringEffectView];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5.0];
[self.respringEffectView setAlpha:0];
[UIView commitAnimations];
[self performSelector:@selector(respring) withObject:nil afterDelay:0.0];

[self performSelector:@selector(respring) withObject:nil afterDelay:3.0];
}];

}];
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];

UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
[confirmRespringAlert addAction:cancel];
[confirmRespringAlert addAction:confirm];

[confirmRespringAlert addAction:cancel];
[confirmRespringAlert addAction:confirm];

[self presentViewController:confirmRespringAlert animated:YES completion:nil];
[self presentViewController:confirmRespringAlert animated:YES completion:nil];
}

@end

Laden…
Annuleren
Opslaan