Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
fix: rename auto update
Vojtěch Škopek355b087b85fe
diff --git a/tweak/Sources/App/About/UpdateNotice.m b/tweak/Sources/App/About/UpdateNotice.mindex dcf23c16..1e976774 100644--- a/tweak/Sources/App/About/UpdateNotice.m+++ b/tweak/Sources/App/About/UpdateNotice.m@@ -81,6 +81,10 @@ static void offerWhenClear(NSInteger tries) {// The first time Spotify is in front, and once: a check every launch would ask GitHub far more often// than the six hours the cache allows anyway, and what a check already landed is enough to go on.void SGWatchForUpdates(void) {+ // TEMPORARY, remove before committing: forgets which release this phone has been told about, so the+ // sheet is offered again for one it has already had (0.20.0 was marked told on 2026-09-20 by a+ // manual Check now, which is what let the sheet through in the first place).+ [NSUserDefaults.standardUserDefaults removeObjectForKey:kTold];if (!SGEnabled(SGKeyUpdateNotice)) return;__block id token = [NSNotificationCenter.defaultCenter addObserverForName:UIApplicationDidBecomeActiveNotificationobject:nildiff --git a/tweak/Sources/App/About/UpdatePage.m b/tweak/Sources/App/About/UpdatePage.mindex 24e491c3..7db8f0f8 100644--- a/tweak/Sources/App/About/UpdatePage.m+++ b/tweak/Sources/App/About/UpdatePage.m@@ -80,7 +80,6 @@ static NSString *longDate(NSString *published) { // 18 September 2026@implementation SGUpdatePageController {NSArray<SGUpdateGroup *> *_groups;UIView *_intro;- UIView *_footer;NSTimer *_ticker;}@@ -141,12 +140,10 @@ static NSArray<SGUpdateRelease *> *releasesToShow(void) {[groups addObject:group(nil, top)];SGUpdateRow *notice = [SGUpdateRow new];- notice.title = @"Tell me when one is out";+ notice.title = @"Auto check updates";notice.symbol = @"bell";notice.key = SGKeyUpdateNotice;- SGUpdateGroup *told = group(nil, @[notice]);- told.footer = @"A release newer than this build brings this up once, a few seconds after Spotify opens.";- [groups addObject:told];+ [groups addObject:group(nil, @[notice])];for (SGUpdateRelease *release in releasesToShow()) {NSMutableArray<NSString *> *kinds = [NSMutableArray array];@@ -186,15 +183,12 @@ static NSArray<SGUpdateRelease *> *releasesToShow(void) {- (void)viewDidLoad {[super viewDidLoad];_intro = SGNote([self introText]);- _footer = SGNote(@"Releases are cut from the commits, so every line here is one change and opens it on GitHub. The mod asks GitHub for them a few seconds after Spotify opens and whenever Mod Settings does, at most once every six hours.");self.tableView.tableHeaderView = _intro;- self.tableView.tableFooterView = _footer;}- (void)viewWillLayoutSubviews {[super viewWillLayoutSubviews];SGFitNote(self.tableView, _intro, 24, 0);- SGFitNote(self.tableView, _footer, 16, 24);}- (void)viewDidLayoutSubviews {diff --git a/tweak/Sources/Redesigned/Kit/SGRGlass.h b/tweak/Sources/Redesigned/Kit/SGRGlass.hindex 29802f77..79142137 100644--- a/tweak/Sources/Redesigned/Kit/SGRGlass.h+++ b/tweak/Sources/Redesigned/Kit/SGRGlass.h@@ -10,7 +10,9 @@#import <UIKit/UIKit.h>// A glass circle inside someone else's round control, `side` across, behind everything the control-// draws (zPosition -1) and kept at its middle by the autoresizing mask. Being the control's own+// draws (first in its subviews, re-asserted on every call, since glass takes what is above it in the+// tree into its backdrop however the depths are set) and kept at its middle by the autoresizing mask.+// Being the control's own// subview it goes wherever the control goes: a frame worked out from outside goes stale when Spotify// lays a row out after the unit that holds it (the player's header circles sat 24pt off until a tap// laid the unit out again, trees/continuous/1.txt 2026-09-17). Takes no touches; made once per controldiff --git a/tweak/Sources/Redesigned/Kit/SGRGlass.m b/tweak/Sources/Redesigned/Kit/SGRGlass.mindex 69518017..90a2cc24 100644--- a/tweak/Sources/Redesigned/Kit/SGRGlass.m+++ b/tweak/Sources/Redesigned/Kit/SGRGlass.m@@ -78,15 +78,20 @@ static UIView *glassInside(UIView *control, const void *key, CGSize size, BOOL cif (!shape) {shape = newShape(mode);shape.accessibilityElementsHidden = YES;- // Last among the control's subviews, so code of Spotify's reading its first subview still finds- // its own; the depth puts it behind them all the same.- shape.layer.zPosition = -1;shape.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin| UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;objc_setAssociatedObject(shape, &kInsideModeKey, @(mode), OBJC_ASSOCIATION_RETAIN_NONATOMIC);objc_setAssociatedObject(control, key, shape, OBJC_ASSOCIATION_RETAIN_NONATOMIC);}if (shape.superview != control) [control addSubview:shape];+ // First among the control's subviews, so the glyph the control draws is genuinely after the shape in the+ // tree. The shape used to be added last and pushed back with zPosition -1 instead, which sorts the+ // compositing but not what glass takes for its backdrop: on the phone the glyph above it was captured+ // into it, so the button showed a soft ghost of its icon through the glass and no icon over it+ // (issue #39, iOS 26.1). The simulator's glass does not refract and shows neither order failing, so this+ // one is ordered the plain way rather than by depth. Re-asserted on every pass the caller makes, since a+ // control that rebuilds its content puts that in at index 0 too and would end up under the shape.+ if (control.subviews.firstObject != shape) [control insertSubview:shape atIndex:0];shape.hidden = size.width <= 0 || size.height <= 0;CGRect bounds = CGRectMake(0, 0, size.width, size.height);if (!CGRectEqualToRect(shape.bounds, bounds)) {diff --git a/tweak/Sources/Redesigned/Kit/SGRPalette.h b/tweak/Sources/Redesigned/Kit/SGRPalette.hindex 1e3381e8..08b38d72 100644--- a/tweak/Sources/Redesigned/Kit/SGRPalette.h+++ b/tweak/Sources/Redesigned/Kit/SGRPalette.h@@ -32,7 +32,10 @@ typedef struct {// `surface` tinted a little towards the artwork's dominant colour (brought down to a luminance of 0.05, then// 35% of it mixed in), so a tile or row on the surface quietly takes its cover's colour while white text on-// it keeps its contrast. nil to the completion when the image has no bitmap to read.+// it keeps its contrast. Never dimmer than `surface`: a mix that came out darker is lifted back to its+// luminance keeping its hue, so a near-black cover cannot cost the tile the step of elevation it stands on,+// nor sink it into the grey band SGRAmoled.x turns pure black. nil to the completion when the image has no+// bitmap to read.+ (void)tintForImage:(UIImage *)image surface:(UIColor *)surface completion:(void (^)(UIColor *tint))completion;@enddiff --git a/tweak/Sources/Redesigned/Kit/SGRPalette.m b/tweak/Sources/Redesigned/Kit/SGRPalette.mindex b1be05ff..33dae2da 100644--- a/tweak/Sources/Redesigned/Kit/SGRPalette.m+++ b/tweak/Sources/Redesigned/Kit/SGRPalette.m@@ -201,10 +201,26 @@ static UIColor *tintOf(CGImageRef image, UIColor *surface) {for (int k = 0; k < 3; k++) linear[k] *= kTintLuminance / luminance;}CGFloat t = kTintShare;- return [UIColor colorWithRed:r * (1 - t) + toEncoded(linear[0]) * t- green:g * (1 - t) + toEncoded(linear[1]) * t- blue:b * (1 - t) + toEncoded(linear[2]) * t- alpha:1];+ CGFloat mixed[3] = {r * (1 - t) + toEncoded(linear[0]) * t,+ g * (1 - t) + toEncoded(linear[1]) * t,+ b * (1 - t) + toEncoded(linear[2]) * t};++ // The colour mixed in is held under a luminance of 0.05 but has no floor, so a near-black cover mixes the+ // surface *down*: the tile ends up darker than the untinted surface it was meant to be a step above, and a+ // neutral one lands in the 1-10% grey band SGRAmoled.x turns pure black, which takes the whole card with+ // it -- a black square lost on a black page (The Weeknd's Trilogy, Bieber's SWAG; issue #36). So a mix+ // dimmer than the surface is lifted back to the surface's luminance, in linear light and by one factor+ // across the channels, which leaves its hue where the mix put it. Lifting cannot clip: the target+ // luminance is the surface's ~0.014, and the most one channel can carry of it is 0.014 / 0.0722.+ CGFloat want = 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);+ CGFloat lit[3] = {toLinear(mixed[0]), toLinear(mixed[1]), toLinear(mixed[2])};+ CGFloat have = 0.2126 * lit[0] + 0.7152 * lit[1] + 0.0722 * lit[2];+ if (have <= 0) return surface;+ if (have < want) {+ for (int k = 0; k < 3; k++) mixed[k] = toEncoded(MIN(1, lit[k] * want / have));+ }++ return [UIColor colorWithRed:mixed[0] green:mixed[1] blue:mixed[2] alpha:1];}@implementation SGRPalette