From cfc4a74afee1eff9479ae214b43da554eb933a38 Mon Sep 17 00:00:00 2001 From: kingbri Date: Fri, 4 Oct 2024 14:52:05 -0400 Subject: [PATCH] Tree: Remove InlineHeader Was a workaround for iOS 15. No longer required. Signed-off-by: kingbri --- Ferrite.xcodeproj/project.pbxproj | 4 ---- Ferrite/Views/CommonViews/InlineHeader.swift | 22 ------------------- .../CommonViews/Modifiers/InlinedList.swift | 1 - .../ComponentViews/Library/HistoryView.swift | 2 +- .../Plugin/Info/PluginInfoAboutView.swift | 2 +- .../Plugin/Info/PluginInfoMetaView.swift | 2 +- .../Plugin/PluginAggregateView.swift | 6 ++--- .../Plugin/Source/SourceSettingsApiView.swift | 2 +- .../Source/SourceSettingsBaseUrlView.swift | 2 +- .../Source/SourceSettingsMethodView.swift | 2 +- .../Settings/Kodi/KodiEditorView.swift | 6 ++--- .../Settings/Kodi/SettingsKodiView.swift | 4 ++-- .../Settings/SettingsAppVersionView.swift | 2 +- .../Settings/SettingsDebridInfoView.swift | 6 ++--- Ferrite/Views/SettingsView.swift | 18 +++++++-------- .../Views/SheetViews/ActionChoiceView.swift | 6 ++--- 16 files changed, 30 insertions(+), 57 deletions(-) delete mode 100644 Ferrite/Views/CommonViews/InlineHeader.swift diff --git a/Ferrite.xcodeproj/project.pbxproj b/Ferrite.xcodeproj/project.pbxproj index 42f5162..82a5dff 100644 --- a/Ferrite.xcodeproj/project.pbxproj +++ b/Ferrite.xcodeproj/project.pbxproj @@ -136,7 +136,6 @@ 0CB0115B29D36D9E009AFEDE /* SearchResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB0115A29D36D9E009AFEDE /* SearchResultsView.swift */; }; 0CB0AB5F29BD2A200015422C /* KodiServerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB0AB5E29BD2A200015422C /* KodiServerView.swift */; }; 0CB6516528C5A5D700DCA721 /* InlinedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB6516428C5A5D700DCA721 /* InlinedList.swift */; }; - 0CB6516A28C5B4A600DCA721 /* InlineHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB6516928C5B4A600DCA721 /* InlineHeader.swift */; }; 0CB725322C123E6F0047FC0B /* CloudDownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB725312C123E6F0047FC0B /* CloudDownloadView.swift */; }; 0CB725342C123E760047FC0B /* CloudMagnetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB725332C123E760047FC0B /* CloudMagnetView.swift */; }; 0CBAB83628D12ED500AC903E /* DisableInteraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CBAB83528D12ED500AC903E /* DisableInteraction.swift */; }; @@ -290,7 +289,6 @@ 0CB0115A29D36D9E009AFEDE /* SearchResultsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultsView.swift; sourceTree = ""; }; 0CB0AB5E29BD2A200015422C /* KodiServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KodiServerView.swift; sourceTree = ""; }; 0CB6516428C5A5D700DCA721 /* InlinedList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlinedList.swift; sourceTree = ""; }; - 0CB6516928C5B4A600DCA721 /* InlineHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlineHeader.swift; sourceTree = ""; }; 0CB725312C123E6F0047FC0B /* CloudDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudDownloadView.swift; sourceTree = ""; }; 0CB725332C123E760047FC0B /* CloudMagnetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudMagnetView.swift; sourceTree = ""; }; 0CBAB83528D12ED500AC903E /* DisableInteraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisableInteraction.swift; sourceTree = ""; }; @@ -583,7 +581,6 @@ 0C44E2A928D4DFC4007711AE /* Modifiers */, 0CDCB91728C662640098B513 /* EmptyInstructionView.swift */, 0CA3FB1F28B91D9500FA10A8 /* IndeterminateProgressView.swift */, - 0CB6516928C5B4A600DCA721 /* InlineHeader.swift */, 0C32FB562890D1F2002BD219 /* ListRowViews.swift */, 0C2D9652299316CC00A504B6 /* Tag.swift */, 0C6771FB29B3E0DB005D38D2 /* HybridSecureField.swift */, @@ -907,7 +904,6 @@ 0CA148DD288903F000DE2211 /* ScrapingViewModel.swift in Sources */, 0C445C62293F9A0B0060744D /* Bundle.swift in Sources */, 0C0755C6293424A200ECA142 /* DebridLabelView.swift in Sources */, - 0CB6516A28C5B4A600DCA721 /* InlineHeader.swift in Sources */, 0CA148D8288903F000DE2211 /* ActionChoiceView.swift in Sources */, 0C41BC6528C2AEB900B47DD6 /* SearchModels.swift in Sources */, 0C68135028BC1A2D00FAD890 /* GithubWrapper.swift in Sources */, diff --git a/Ferrite/Views/CommonViews/InlineHeader.swift b/Ferrite/Views/CommonViews/InlineHeader.swift deleted file mode 100644 index fb5dadb..0000000 --- a/Ferrite/Views/CommonViews/InlineHeader.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// InlineHeader.swift -// Ferrite -// -// Created by Brian Dashore on 9/5/22. -// -// For iOS 15's weird defaults regarding sectioned list padding -// - -import SwiftUI - -struct InlineHeader: View { - let title: String - - init(_ title: String) { - self.title = title - } - - var body: some View { - Text(title) - } -} diff --git a/Ferrite/Views/CommonViews/Modifiers/InlinedList.swift b/Ferrite/Views/CommonViews/Modifiers/InlinedList.swift index 185e753..0c39aac 100644 --- a/Ferrite/Views/CommonViews/Modifiers/InlinedList.swift +++ b/Ferrite/Views/CommonViews/Modifiers/InlinedList.swift @@ -5,7 +5,6 @@ // Created by Brian Dashore on 9/4/22. // // Removes the top padding on unsectioned lists -// If a list is sectioned, see InlineHeader // import SwiftUI diff --git a/Ferrite/Views/ComponentViews/Library/HistoryView.swift b/Ferrite/Views/ComponentViews/Library/HistoryView.swift index 8670c80..7f9f5af 100644 --- a/Ferrite/Views/ComponentViews/Library/HistoryView.swift +++ b/Ferrite/Views/ComponentViews/Library/HistoryView.swift @@ -76,7 +76,7 @@ struct HistorySectionView: View { var body: some View { if compareGroup(historyGroup) > 0 { - Section(header: InlineHeader(formatter.string(from: historyGroup[0].date ?? Date()))) { + Section(formatter.string(from: historyGroup[0].date ?? Date())) { ForEach(historyGroup, id: \.self) { history in ForEach(history.entryArray.filter { allEntries.contains($0) }, id: \.self) { entry in HistoryButtonView(entry: entry) diff --git a/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoAboutView.swift b/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoAboutView.swift index b6c95c5..276492c 100644 --- a/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoAboutView.swift +++ b/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoAboutView.swift @@ -11,7 +11,7 @@ struct PluginInfoAboutView: View { @ObservedObject var selectedPlugin: P var body: some View { - Section(header: InlineHeader("Description")) { + Section("Description") { VStack(alignment: .leading, spacing: 10) { if let pluginAbout = selectedPlugin.about { if pluginAbout.last == "\n" { diff --git a/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoMetaView.swift b/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoMetaView.swift index 76e9cd9..8ff7619 100644 --- a/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoMetaView.swift +++ b/Ferrite/Views/ComponentViews/Plugin/Info/PluginInfoMetaView.swift @@ -16,7 +16,7 @@ struct PluginInfoMetaView: View { ) var pluginLists: FetchedResults var body: some View { - Section(header: InlineHeader("Metadata")) { + Section("Metadata") { VStack(alignment: .leading) { VStack(alignment: .leading, spacing: 5) { HStack(spacing: 5) { diff --git a/Ferrite/Views/ComponentViews/Plugin/PluginAggregateView.swift b/Ferrite/Views/ComponentViews/Plugin/PluginAggregateView.swift index 3dd06ad..1ebd0e6 100644 --- a/Ferrite/Views/ComponentViews/Plugin/PluginAggregateView.swift +++ b/Ferrite/Views/ComponentViews/Plugin/PluginAggregateView.swift @@ -39,7 +39,7 @@ struct PluginAggregateView: View { searchText: searchText ) if !filteredUpdatedPlugins.isEmpty { - Section(header: InlineHeader("Updates")) { + Section("Updates") { ForEach(filteredUpdatedPlugins, id: \.self) { (updatedPlugin: PJ) in PluginCatalogButtonView(availablePlugin: updatedPlugin, needsUpdate: true) } @@ -47,7 +47,7 @@ struct PluginAggregateView: View { } if !installedPlugins.isEmpty { - Section(header: InlineHeader("Installed")) { + Section("Installed") { ForEach(installedPlugins, id: \.self) { installedPlugin in InstalledPluginButtonView( installedPlugin: installedPlugin, @@ -64,7 +64,7 @@ struct PluginAggregateView: View { searchText: searchText ) if !filteredAvailablePlugins.isEmpty { - Section(header: InlineHeader("Catalog")) { + Section("Catalog") { ForEach(filteredAvailablePlugins, id: \.self) { availablePlugin in PluginCatalogButtonView(availablePlugin: availablePlugin, needsUpdate: false) } diff --git a/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsApiView.swift b/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsApiView.swift index b730c98..4459230 100644 --- a/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsApiView.swift +++ b/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsApiView.swift @@ -19,7 +19,7 @@ struct SourceSettingsApiView: View { var body: some View { Section( - header: InlineHeader("API credentials"), + header: Text("API credentials"), footer: Text("Grab the required API credentials from the website. A client secret can be an API token.") ) { if let clientId = selectedSourceApi.clientId, clientId.dynamic { diff --git a/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsBaseUrlView.swift b/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsBaseUrlView.swift index 5c19f98..b8a0a3a 100644 --- a/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsBaseUrlView.swift +++ b/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsBaseUrlView.swift @@ -13,7 +13,7 @@ struct SourceSettingsBaseUrlView: View { @State private var tempSite: String = "" var body: some View { Section( - header: InlineHeader("Base URL"), + header: Text("Base URL"), footer: Text("Enter the base URL of your server.") ) { TextField("https://...", text: $tempSite, onEditingChanged: { isFocused in diff --git a/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsMethodView.swift b/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsMethodView.swift index c1de425..0982789 100644 --- a/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsMethodView.swift +++ b/Ferrite/Views/ComponentViews/Plugin/Source/SourceSettingsMethodView.swift @@ -11,7 +11,7 @@ struct SourceSettingsMethodView: View { @ObservedObject var selectedSource: Source var body: some View { - Section(header: InlineHeader("Fetch method")) { + Section("Fetch method") { Picker("", selection: $selectedSource.preferredParser) { if selectedSource.jsonParser != nil { Text("Website API").tag(SourcePreferredParser.siteApi.rawValue) diff --git a/Ferrite/Views/ComponentViews/Settings/Kodi/KodiEditorView.swift b/Ferrite/Views/ComponentViews/Settings/Kodi/KodiEditorView.swift index 5d43c58..98e9b31 100644 --- a/Ferrite/Views/ComponentViews/Settings/Kodi/KodiEditorView.swift +++ b/Ferrite/Views/ComponentViews/Settings/Kodi/KodiEditorView.swift @@ -29,7 +29,7 @@ struct KodiEditorView: View { Form { Group { Section( - header: InlineHeader("URL"), + header: Text("URL"), footer: Text("Must follow the format http(s)://:") ) { TextField("Enter URL", text: $serverUrl) @@ -37,14 +37,14 @@ struct KodiEditorView: View { } Section( - header: InlineHeader("Friendly name"), + header: Text("Friendly name"), footer: Text("Defaults to the URL if not provided") ) { TextField("Friendly name", text: $friendlyName) } Section( - header: InlineHeader("Credentials"), + header: Text("Credentials"), footer: Text("Only use for clients with authentication") ) { TextField("Username", text: $username) diff --git a/Ferrite/Views/ComponentViews/Settings/Kodi/SettingsKodiView.swift b/Ferrite/Views/ComponentViews/Settings/Kodi/SettingsKodiView.swift index ef074ab..873a777 100644 --- a/Ferrite/Views/ComponentViews/Settings/Kodi/SettingsKodiView.swift +++ b/Ferrite/Views/ComponentViews/Settings/Kodi/SettingsKodiView.swift @@ -18,7 +18,7 @@ struct SettingsKodiView: View { var body: some View { List { - Section(header: InlineHeader("Description")) { + Section("Description") { VStack(alignment: .leading, spacing: 10) { Text("Kodi is an external application that is used to manage a local media library and playback.") @@ -27,7 +27,7 @@ struct SettingsKodiView: View { } Section( - header: InlineHeader("Servers"), + header: Text("Servers"), footer: Text("Edit a server by holding it and accessing the context menu") ) { if kodiServers.isEmpty { diff --git a/Ferrite/Views/ComponentViews/Settings/SettingsAppVersionView.swift b/Ferrite/Views/ComponentViews/Settings/SettingsAppVersionView.swift index 5e31365..33d3101 100644 --- a/Ferrite/Views/ComponentViews/Settings/SettingsAppVersionView.swift +++ b/Ferrite/Views/ComponentViews/Settings/SettingsAppVersionView.swift @@ -20,7 +20,7 @@ struct SettingsAppVersionView: View { ProgressView() } else if !releases.isEmpty { List { - Section(header: InlineHeader("GitHub links")) { + Section("GitHub links") { ForEach(releases, id: \.self) { release in ListRowLinkView(text: release.tagName, link: release.htmlUrl) } diff --git a/Ferrite/Views/ComponentViews/Settings/SettingsDebridInfoView.swift b/Ferrite/Views/ComponentViews/Settings/SettingsDebridInfoView.swift index 7955084..ba65227 100644 --- a/Ferrite/Views/ComponentViews/Settings/SettingsDebridInfoView.swift +++ b/Ferrite/Views/ComponentViews/Settings/SettingsDebridInfoView.swift @@ -16,7 +16,7 @@ struct SettingsDebridInfoView: View { var body: some View { List { - Section(header: InlineHeader("Description")) { + Section("Description") { VStack(alignment: .leading, spacing: 10) { Text(debridSource.description ?? "\(debridSource.id) is a debrid service that is used for downloads and media playback. You must pay to access the service." @@ -27,7 +27,7 @@ struct SettingsDebridInfoView: View { } Section( - header: InlineHeader("Login status"), + header: Text("Login status"), footer: Text("A WebView will show up to prompt you for credentials") ) { Button { @@ -58,7 +58,7 @@ struct SettingsDebridInfoView: View { } Section( - header: InlineHeader("API key"), + header: Text("API key"), footer: Text("Add a permanent API key here. Only use this if web authentication does not work!") ) { HybridSecureField( diff --git a/Ferrite/Views/SettingsView.swift b/Ferrite/Views/SettingsView.swift index 980c098..028fda5 100644 --- a/Ferrite/Views/SettingsView.swift +++ b/Ferrite/Views/SettingsView.swift @@ -44,13 +44,13 @@ struct SettingsView: View { var body: some View { NavigationStack { Form { - Section(header: InlineHeader("Debrid services")) { + Section("Debrid services") { ForEach(debridManager.debridSources, id: \.id) { (debridSource: DebridSource) in SettingsDebridLinkView(debridSource: debridSource) } } - Section(header: InlineHeader("Playback services")) { + Section("Playback services") { NavigationLink { SettingsKodiView(kodiServers: kodiServers) } label: { @@ -64,7 +64,7 @@ struct SettingsView: View { } Section( - header: InlineHeader("Behavior"), + header: Text("Behavior"), footer: VStack(alignment: .leading, spacing: 8) { Text("Temporarily disable ephemeral auth if you cannot log into a service") Text("Only disable search timeout if results are slow to fetch") @@ -111,13 +111,13 @@ struct SettingsView: View { } } - Section(header: InlineHeader("Plugin management")) { + Section("Plugin management") { NavigationLink("Plugin lists") { SettingsPluginListView() } } - Section(header: InlineHeader("Default actions")) { + Section("Default actions") { if !debridManager.enabledDebrids.isEmpty { NavigationLink { DefaultActionPickerView( @@ -175,13 +175,13 @@ struct SettingsView: View { } } - Section(header: InlineHeader("Backups")) { + Section("Backups") { NavigationLink("Backups") { BackupsView() } } - Section(header: InlineHeader("Updates")) { + Section("Updates") { Toggle(isOn: $autoUpdateNotifs) { Text("Show update alerts") } @@ -191,7 +191,7 @@ struct SettingsView: View { } } - Section(header: InlineHeader("Information")) { + Section("Information") { ListRowLinkView(text: "Donate", link: "https://ko-fi.com/kingbri") ListRowLinkView(text: "Report issues", link: "https://github.com/bdashore3/Ferrite/issues") @@ -200,7 +200,7 @@ struct SettingsView: View { } } - Section(header: InlineHeader("Debug")) { + Section("Debug") { NavigationLink("Logs") { SettingsLogView() } diff --git a/Ferrite/Views/SheetViews/ActionChoiceView.swift b/Ferrite/Views/SheetViews/ActionChoiceView.swift index ba36d98..c19792d 100644 --- a/Ferrite/Views/SheetViews/ActionChoiceView.swift +++ b/Ferrite/Views/SheetViews/ActionChoiceView.swift @@ -31,7 +31,7 @@ struct ActionChoiceView: View { var body: some View { NavigationStack { Form { - Section(header: InlineHeader("Now Playing")) { + Section("Now Playing") { VStack(alignment: .leading, spacing: 5) { Text(navModel.selectedTitle) .font(.callout) @@ -46,7 +46,7 @@ struct ActionChoiceView: View { } if !debridManager.downloadUrl.isEmpty { - Section(header: InlineHeader("Debrid options")) { + Section("Debrid options") { ForEach(actions, id: \.id) { action in if action.requires.contains(ActionRequirement.debrid.rawValue) { ListRowButtonView(action.name, systemImage: "arrow.up.forward.app.fill") { @@ -91,7 +91,7 @@ struct ActionChoiceView: View { } if !navModel.resultFromCloud { - Section(header: InlineHeader("Magnet options")) { + Section("Magnet options") { ForEach(actions, id: \.id) { action in if action.requires.contains(ActionRequirement.magnet.rawValue) { ListRowButtonView(action.name, systemImage: "arrow.up.forward.app.fill") {