diff --git a/Sora/SoraApp.swift b/Sora/SoraApp.swift index 8729080..96d74a1 100644 --- a/Sora/SoraApp.swift +++ b/Sora/SoraApp.swift @@ -14,6 +14,10 @@ struct SoraApp: App { @StateObject private var librarykManager = LibraryManager() init() { + if let userAccentColor = UserDefaults.standard.color(forKey: "accentColor") { + UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = userAccentColor + } + TraktToken.checkAuthenticationStatus { isAuthenticated in if isAuthenticated { Logger.shared.log("Trakt authentication is valid") diff --git a/Sora/Utils/Extensions/UserDefaults.swift b/Sora/Utils/Extensions/UserDefaults.swift new file mode 100644 index 0000000..4bb4435 --- /dev/null +++ b/Sora/Utils/Extensions/UserDefaults.swift @@ -0,0 +1,19 @@ +// +// UserDefaults.swift +// Sulfur +// +// Created by Francesco on 11/05/25. +// + +import UIKit + +extension UserDefaults { + func color(forKey key: String) -> UIColor? { + guard let colorData = data(forKey: key) else { return nil } + do { + return try NSKeyedUnarchiver.unarchivedObject(ofClass: UIColor.self, from: colorData) + } catch { + return nil + } + } +} diff --git a/Sora/Views/MediaInfoView/MediaInfoView.swift b/Sora/Views/MediaInfoView/MediaInfoView.swift index 9d4b525..ae1485d 100644 --- a/Sora/Views/MediaInfoView/MediaInfoView.swift +++ b/Sora/Views/MediaInfoView/MediaInfoView.swift @@ -467,7 +467,7 @@ struct MediaInfoView: View { showStreamLoadingView = false } } message: { - VStack { + HStack { Text("Loading Episode \(selectedEpisodeNumber)...") ProgressView() .padding(.top, 8) diff --git a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewModule.swift b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewModule.swift index b75b02b..ee4abf4 100644 --- a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewModule.swift +++ b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewModule.swift @@ -193,7 +193,7 @@ struct SettingsViewModule: View { self.displayModuleView(url: pasteboardString) })) - clipboardAlert.addAction(UIAlertAction(title: "Enter Manually", style: .cancel, handler: { _ in + clipboardAlert.addAction(UIAlertAction(title: "Enter Manually", style: .default, handler: { _ in self.showManualUrlAlert() })) diff --git a/Sulfur.xcodeproj/project.pbxproj b/Sulfur.xcodeproj/project.pbxproj index 39c37c4..b49a6b8 100644 --- a/Sulfur.xcodeproj/project.pbxproj +++ b/Sulfur.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 13103E8E2D58E04A000F0673 /* SkeletonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13103E8D2D58E04A000F0673 /* SkeletonCell.swift */; }; 131270172DC13A010093AA9C /* DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131270162DC13A010093AA9C /* DownloadManager.swift */; }; 131270192DC13A3C0093AA9C /* DownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131270182DC13A3C0093AA9C /* DownloadView.swift */; }; + 1314D0AE2DD0F4BB00759A3F /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1314D0AD2DD0F4BB00759A3F /* UserDefaults.swift */; }; 131845F92D47C62D00CA7A54 /* SettingsViewGeneral.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131845F82D47C62D00CA7A54 /* SettingsViewGeneral.swift */; }; 1327FBA72D758CEA00FC6689 /* Analytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1327FBA62D758CEA00FC6689 /* Analytics.swift */; }; 1327FBA92D758DEA00FC6689 /* UIDevice+Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1327FBA82D758DEA00FC6689 /* UIDevice+Model.swift */; }; @@ -76,6 +77,7 @@ 13103E8D2D58E04A000F0673 /* SkeletonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkeletonCell.swift; sourceTree = ""; }; 131270162DC13A010093AA9C /* DownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadManager.swift; sourceTree = ""; }; 131270182DC13A3C0093AA9C /* DownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadView.swift; sourceTree = ""; }; + 1314D0AD2DD0F4BB00759A3F /* UserDefaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaults.swift; sourceTree = ""; }; 131845F82D47C62D00CA7A54 /* SettingsViewGeneral.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewGeneral.swift; sourceTree = ""; }; 1327FBA62D758CEA00FC6689 /* Analytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Analytics.swift; sourceTree = ""; }; 1327FBA82D758DEA00FC6689 /* UIDevice+Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIDevice+Model.swift"; sourceTree = ""; }; @@ -287,6 +289,7 @@ 73D164D42D8B5B340011A360 /* JavaScriptCore+Extensions.swift */, 136BBE7F2DB1038000906B5E /* Notification+Name.swift */, 1327FBA82D758DEA00FC6689 /* UIDevice+Model.swift */, + 1314D0AD2DD0F4BB00759A3F /* UserDefaults.swift */, 133D7C872D2BE2640075467E /* URLSession.swift */, 1359ED132D76F49900C13034 /* finTopView.swift */, 13CBEFD92D5F7D1200D011EE /* String.swift */, @@ -543,6 +546,7 @@ 132AF1252D9995F900A0140B /* JSController-Search.swift in Sources */, 1EF5C3A92DB988E40032BF07 /* CommunityLib.swift in Sources */, 13CBEFDA2D5F7D1200D011EE /* String.swift in Sources */, + 1314D0AE2DD0F4BB00759A3F /* UserDefaults.swift in Sources */, 1E26E9E72DA9577900B9DC02 /* VolumeSlider.swift in Sources */, 136BBE802DB1038000906B5E /* Notification+Name.swift in Sources */, 13DB46902D900A38008CBC03 /* URL.swift in Sources */,