Sfoglia il codice sorgente

Fixed Color Picker and added Reset button

master
mac-user669 4 anni fa
parent
commit
5b26ad7238
3 ha cambiato i file con 43 aggiunte e 1 eliminazioni
  1. +1
    -1
      Tweak.xm
  2. +31
    -0
      zenithdarkprefs/Resources/Root.plist
  3. +11
    -0
      zenithdarkprefs/ZNDarkPrefsRootListController.m

+ 1
- 1
Tweak.xm Vedi File

@@ -46,7 +46,7 @@ else {
colourString = [preferencesDictionary objectForKey: @"kCustomDarkColor"];
}

UIColor* darkColor = [SparkColourPickerUtils colourWithString: colourString withFallback: @"#FF00FF"];
UIColor* darkColor = [SparkColourPickerUtils colourWithString: colourString withFallback: @"#000000:0.44"];

// by default have our tweak overide this.
if (@available(iOS 13, *)) {

+ 31
- 0
zenithdarkprefs/Resources/Root.plist Vedi File

@@ -46,6 +46,8 @@
<string>PSGroupCell</string>
<key>label</key>
<string>Color Options</string>
<key>footerText</key>
<string>Default: #000000:0.44</string>
</dict>
<dict>
<key>cell</key>
@@ -109,6 +111,35 @@
<key>label</key>
<string>About</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string></string>
<key>footerText</key>
<string></string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Reset Settings</string>
<key>action</key>
<string>resetSettings</string>
<key>confirmation</key>
<dict>
<key>title</key>
<string>Reset</string>
<key>prompt</key>
<string>Reset all settings?</string>
<key>okTitle</key>
<string>Reset</string>
<key>cancelTitle</key>
<string>Cancel</string>
</dict>
</dict>
</array>
<key>title</key>
<string></string>

+ 11
- 0
zenithdarkprefs/ZNDarkPrefsRootListController.m Vedi File

@@ -2,6 +2,7 @@
#import <CepheiPrefs/HBAppearanceSettings.h>
#import <Cephei/HBRespringController.h>
#import <Cephei/HBPreferences.h>
#import "SparkColourPickerUtils.h"

#define THEME_COLOR \
[UIColor colorWithRed:0.82 \
@@ -23,6 +24,16 @@
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(shareTapped)];
}

- (void)resetSettings {
CFArrayRef keyList = CFPreferencesCopyKeyList(CFSTR("com.mac-user669.zenithdark"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
if (keyList) {
CFPreferencesSetMultiple(nil, keyList, CFSTR("com.mac-user669.zenithdark"), kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFRelease(keyList);
}
[[NSFileManager defaultManager] removeItemAtPath:@"/var/mobile/Library/Preferences/com.mac-user669.zenithdark.plist" error:nil];

[self respring];
}

// Hide Large Title
- (void)viewDidLoad {

Loading…
Annulla
Salva