Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C

refactor: the marquee label moves to Settings/ so every layer can use it

My-Name-Is-Jeff9f4ace9d8ef1
diff --git a/docs/tweaks.md b/docs/tweaks.md
index 7dec7243..1f368ac3 100644
--- a/docs/tweaks.md
+++ b/docs/tweaks.md
@@ -10,7 +10,8 @@
tweak/Sources/Settings/ the Mod Settings framework: SGPage (a page on Spotify's stack), SGModPage (sections
of rows: switches, choices, sliders, links, rows shown only while a choice
asks for them, and rows greyed out while the switch they wait on is off, a tap
- on one nudging that switch), SGPageStyle (the system Settings look), SGGlowSwitch
+ on one nudging that switch), SGPageStyle (the system Settings look), SGGlowSwitch,
+ SGMarquee (a title that glides side to side when it is too long, for every layer)
tweak/Sources/Shared/ what works the same with either look, see Layers below
tweak/Sources/Native/ tweaks on Spotify's own screens, running only while Redesigned UI is off
tweak/Sources/Redesigned/ the redesign, running only while Redesigned UI is on
diff --git a/harness/player/build.sh b/harness/player/build.sh
index 4ecaf651..1dbbeac3 100755
--- a/harness/player/build.sh
+++ b/harness/player/build.sh
@@ -21,7 +21,7 @@ xcrun -sdk iphonesimulator clang -target arm64-apple-ios17.0-simulator -fobjc-ar
"$SRC"/Core/SGBackdrop.m "$SRC"/Core/SGFlagForce.m "$SRC"/Core/SGUIMode.m \
"$SRC"/Redesigned/Kit/SGRTokens.m "$SRC"/Redesigned/Kit/SGRPalette.m "$SRC"/Redesigned/Kit/SGRField.m "$SRC"/Redesigned/Kit/SGRFlow.m "$SRC"/Redesigned/Kit/SGRFluid.m "$SRC"/Shared/AnimatedArtwork/SGMotionCatalog.m "$SRC"/Shared/AnimatedArtwork/SGMotionStore.m \
"$SRC"/Shared/AnimatedArtwork/SGMotionFollower.m "$SRC"/Shared/AnimatedArtwork/SGMotionClip.m \
- "$SRC"/Redesigned/Kit/SGRGlass.m "$SRC"/Redesigned/Kit/SGRMarquee.m "$SRC"/Redesigned/Kit/SGRGlyph.m "$SRC"/Redesigned/Kit/SGRRestyle.m \
+ "$SRC"/Redesigned/Kit/SGRGlass.m "$SRC"/Settings/SGMarquee.m "$SRC"/Redesigned/Kit/SGRGlyph.m "$SRC"/Redesigned/Kit/SGRRestyle.m \
"$SRC"/Redesigned/Kit/SGRedesign.m \
"$SRC"/Redesigned/Player/PlayerSettings.m "$SRC"/Redesigned/Player/PlayerVisualiser.m "$SRC"/Redesigned/Player/SGRSpectrum.m "$SRC"/Redesigned/NowPlayingBar/NowPlayingBarSettings.m \
"$SRC"/Settings/SGPage.m "$SRC"/Settings/SGPageStyle.m "$SRC"/Settings/SGModPage.m "$SRC"/Settings/SGGlowSwitch.m \
diff --git a/tweak/Sources/Redesigned/Kit/SGRKit.h b/tweak/Sources/Redesigned/Kit/SGRKit.h
index 36c63ce6..4dff3906 100644
--- a/tweak/Sources/Redesigned/Kit/SGRKit.h
+++ b/tweak/Sources/Redesigned/Kit/SGRKit.h
@@ -16,6 +16,7 @@
// SGRBridges.h player state, now playing artwork, the player's open and close
// SGRRepaint.h the areas the redesign keeps transparent when Spotify repaints them
// SGRAccent.h the redesign's accent colour; its AMOLED black is SGRAmoled.x, always on
+// Settings/SGMarquee.h a title that glides when it is too long, every layer's, imported here for the screens
//
// Every hook file of the redesign starts its %ctor with `if (!SGRedesignedUI()) return;` and every one
// of Native/ with `if (!SGNativeUI()) return;` (Core/SGUIMode.h), so the two looks never run together.
@@ -33,4 +34,4 @@
#import "SGRBridges.h"
#import "SGRRepaint.h"
#import "SGRAccent.h"
-#import "SGRMarquee.h"
+#import "Settings/SGMarquee.h"
diff --git a/tweak/Sources/Redesigned/Player/PlayerLandscape.x b/tweak/Sources/Redesigned/Player/PlayerLandscape.x
index fbe98f40..a250abf6 100644
--- a/tweak/Sources/Redesigned/Player/PlayerLandscape.x
+++ b/tweak/Sources/Redesigned/Player/PlayerLandscape.x
@@ -32,7 +32,7 @@ static BOOL sg_shut;
@implementation SGRLandscapeLyricsController {
SGRArtworkField *_field;
UIImageView *_cover;
- SGRMarqueeLabel *_title, *_artist;
+ SGMarqueeLabel *_title, *_artist;
UIStackView *_controls;
UIButton *_play, *_close;
UIView *_stage; // the lines' own view: the karaoke view dims every sibling it has
@@ -103,9 +103,9 @@ static UIButton *controlButton(NSString *symbol, CGFloat size, NSString *label,
[self.view addSubview:_cover];
// A title or artist too long for the column scrolls, as the player's own do.
- _title = [SGRMarqueeLabel new];
+ _title = [SGMarqueeLabel new];
_title.textColor = UIColor.whiteColor;
- _artist = [SGRMarqueeLabel new];
+ _artist = [SGMarqueeLabel new];
_artist.textColor = [UIColor colorWithWhite:1 alpha:0.6];
[self applyFonts];
[self.view addSubview:_title];
diff --git a/tweak/Sources/Redesigned/Kit/SGRMarquee.h b/tweak/Sources/Settings/SGMarquee.h
similarity index 93%
rename from tweak/Sources/Redesigned/Kit/SGRMarquee.h
rename to tweak/Sources/Settings/SGMarquee.h
index cf10b057..72b75665 100644
--- a/tweak/Sources/Redesigned/Kit/SGRMarquee.h
+++ b/tweak/Sources/Settings/SGMarquee.h
@@ -5,7 +5,7 @@
// Threading: main thread only.
#import <UIKit/UIKit.h>
-@interface SGRMarqueeLabel : UIView
+@interface SGMarqueeLabel : UIView
@property (nonatomic, copy) NSString *text;
@property (nonatomic, strong) UIFont *font;
@property (nonatomic, strong) UIColor *textColor;
diff --git a/tweak/Sources/Redesigned/Kit/SGRMarquee.m b/tweak/Sources/Settings/SGMarquee.m
similarity index 98%
rename from tweak/Sources/Redesigned/Kit/SGRMarquee.m
rename to tweak/Sources/Settings/SGMarquee.m
index b1015f56..62458ba9 100644
--- a/tweak/Sources/Redesigned/Kit/SGRMarquee.m
+++ b/tweak/Sources/Settings/SGMarquee.m
@@ -1,11 +1,11 @@
-#import "SGRMarquee.h"
+#import "SGMarquee.h"
// Points a second the text moves at, the rest at each end, and the fade over the edge it runs past.
static const CGFloat kSpeed = 30, kFade = 16;
static const CFTimeInterval kRest = 2;
static NSString *const kScroll = @"sg.marquee";
-@implementation SGRMarqueeLabel {
+@implementation SGMarqueeLabel {
UILabel *_label;
CAGradientLayer *_fade;
CGFloat _scrolled; // how far the running animation travels, 0 while still