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

This commit is contained in:
2020-01-25 19:38:31 -05:00
parent 4497903f66
commit cf5a0d7bff
3 changed files with 17 additions and 49 deletions

View File

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

View File

@ -14,25 +14,3 @@
@property (nonatomic, strong) UIVisualEffectView *respringEffectView; @property (nonatomic, strong) UIVisualEffectView *respringEffectView;
@property (nonatomic, strong) UIWindow *mainAppRootWindow; @property (nonatomic, strong) UIWindow *mainAppRootWindow;
@end @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

View File

@ -1,5 +1,7 @@
#import "ZNDarkPrefsRootListController.h" #import "ZNDarkPrefsRootListController.h"
#import <CepheiPrefs/HBAppearanceSettings.h> #import <CepheiPrefs/HBAppearanceSettings.h>
#import <Cephei/HBRespringController.h>
#import <Cephei/HBPreferences.h>
#define THEME_COLOR \ #define THEME_COLOR \
[UIColor colorWithRed:0.82 \ [UIColor colorWithRed:0.82 \
@ -44,6 +46,7 @@
} }
// End of "Hide Large Title" // End of "Hide Large Title"
//share button action //share button action
- (void)shareTapped { - (void)shareTapped {
@ -78,30 +81,16 @@
} }
- (void)respring { - (void)respring {
NSTask *task = [[[NSTask alloc] init] autorelease]; [[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil]; // Dismisses keyboard
[task setLaunchPath:@"/usr/bin/killall"]; [HBRespringController respringAndReturnTo:[NSURL URLWithString:@"prefs:root=ZenithDark"]];
[task setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
[task launch];
} }
-(void)doAFancyRespring { -(void)respringPopUp {
UIAlertController *confirmRespringAlert = [UIAlertController alertControllerWithTitle:@"Apply Settings?" message:@"This will respring your device." preferredStyle:UIAlertControllerStyleActionSheet]; 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) { UIAlertAction *confirm = [UIAlertAction actionWithTitle:@"Respring" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
// blur then respring our device! [self performSelector:@selector(respring) withObject:nil afterDelay:0.0];
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:3.0];
}]; }];
@ -110,6 +99,7 @@
[confirmRespringAlert addAction:cancel]; [confirmRespringAlert addAction:cancel];
[confirmRespringAlert addAction:confirm]; [confirmRespringAlert addAction:confirm];
[self presentViewController:confirmRespringAlert animated:YES completion:nil]; [self presentViewController:confirmRespringAlert animated:YES completion:nil];
} }