Browse Source

1.7

master
mac-user669 4 years ago
parent
commit
2b22bc0eea
5 changed files with 44 additions and 16 deletions
  1. +32
    -2
      Tweak.xm
  2. +3
    -3
      control
  3. +1
    -1
      zenithdarkprefs/Makefile
  4. +5
    -7
      zenithdarkprefs/Resources/Root.plist
  5. +3
    -3
      zenithdarkprefs/ZNDarkPrefsRootListController.m

+ 32
- 2
Tweak.xm View File

@@ -17,7 +17,7 @@ inline NSString *StringForPreferenceKey(NSString *key) {
return prefs[key];
}

%group TweakGroup
%group Tweak13
%hook ZNGrabberAccessoryView

// this is called when iOS 13's dark mode is enabled!
@@ -66,6 +66,29 @@ inline NSString *StringForPreferenceKey(NSString *key) {
%end
%end

static BOOL ios13;

%group Tweak12

//We then hook the class in this case Zenith's grabber view is called “ZNGrabberAccessoryView”
%hook ZNGrabberAccessoryView
// The method we then modify is this method that is called from UIImageView to set the backgroundColor of the image view.
// Since the grabber view is of type UIImageView we can modify this method :)

-(void)setBackgroundColor:(UIColor *)backgroundColor {
if (kCustomDarkColorEnabled) {
%orig([UIColor cscp_colorFromHexString:StringForPreferenceKey(@"kDarkCustomColor")]);
}

else {
%orig(kDarkModeColor);
}
}

// 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
%end
%end

static void loadPrefs() { // Load preferences to make sure changes are written to the plist

// Thanks to skittyblock!
@@ -100,7 +123,14 @@ static void PreferencesChangedCallback(CFNotificationCenterRef center, void *obs
loadPrefs(); // Load our prefs

if (kEnabled) { // If enabled
%init(TweakGroup); // Enable the group "TweakGroup"
if (@available(iOS 13, *)) { // If the device is running iOS 13
ios13 = YES; // Set "iOS13" to "YES"
%init(Tweak13); // Enable the group "Tweak13"
} else {
ios13 = NO; // Set "iOS13" to "NO"
%init(Tweak12); // Enable the group "Tweak12"
}

}

CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback) PreferencesChangedCallback, CFSTR("com.mac-user669.zenithdark.prefschanged"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);

+ 3
- 3
control View File

@@ -1,10 +1,10 @@
Package: com.mac-user669.zenithdark
Version: 1.6
Version: 1.7
Architecture: iphoneos-arm
Maintainer: mac-user669 <cooper@cooperhull.com>
Depends: mobilesubstrate, preferenceloader, com.muirey03.zenith, ws.hbang.common (>= 1.11), firmware (>=13.0), org.thebigboss.libcolorpicker
Depends: mobilesubstrate, preferenceloader, com.muirey03.zenith, ws.hbang.common (>= 1.14), com.creaturesurvive.libcscolorpicker
Section: Tweaks
Description: Changes Zeniths tabs to a dark blur
Description: Changes Zenith's tab color!
Author: mac-user669 <cooper@cooperhull.com>
Name: ZenithDark
Sileodepiction: https://mac-user669.github.io/repo/sileodepictions/ZenithDark.json

+ 1
- 1
zenithdarkprefs/Makefile View File

@@ -1,7 +1,7 @@
ARCHS = arm64 arm64e
SDK = iPhoneOS12.2
FINALPACKAGE = 1
TARGET = iphone:12.2:13.0
TARGET = iphone:12.2:12.0


include $(THEOS)/makefiles/common.mk

+ 5
- 7
zenithdarkprefs/Resources/Root.plist View File

@@ -12,9 +12,9 @@
<key>packageIdentifier</key>
<string>com.mac-user669.zenithdark</string>
<key>titleColor</key>
<string>#D0A400</string>
<string>#f5bc00</string>
<key>subtitleColor</key>
<string>#D0A400</string>
<string>#f5bc00</string>
</dict>

<dict>
@@ -92,9 +92,8 @@
<key>label</key>
<string></string>
<key>footerText</key>
<string></string>
<string>Note: This won't affect anything on iOS 12</string>
</dict>

<dict>
<key>cell</key>
<string>PSSwitchCell</string>
@@ -109,16 +108,15 @@
<key>PostNotification</key>
<string>com.mac-user669.zenithdark.prefschanged</string>
</dict>

<dict>
<key>PostNotification</key>
<string>com.mac-user669.zenithdark.prefschanged</string>
<string>com.mac-user669.zenithdark.prefschanged</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>CSColorDisplayCell</string>
<key>defaults</key>
<string>com.mac-user669.zenithdark</string>
<string>com.mac-user669.zenithdark</string>
<key>defaultsPath</key>
<string>/Library/PreferenceBundles/ZenithDark.bundle</string>
<key>key</key>

+ 3
- 3
zenithdarkprefs/ZNDarkPrefsRootListController.m View File

@@ -2,10 +2,10 @@
#include <CSColorPicker/CSColorPicker.h>

#define THEME_COLOR \
[UIColor colorWithRed:0.82 \
green:0.64 \
[UIColor colorWithRed:0.96 \
green:0.74 \
blue:0.00 \
alpha:1.0];
alpha:1.00];


@implementation ZNDarkPrefsRootListController

Loading…
Cancel
Save