Tree: Remove InlineHeader

Was a workaround for iOS 15. No longer required.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-10-04 14:52:05 -04:00
parent 7bb4ed5f7c
commit cfc4a74afe
16 changed files with 30 additions and 57 deletions

View file

@ -136,7 +136,6 @@
0CB0115B29D36D9E009AFEDE /* SearchResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB0115A29D36D9E009AFEDE /* SearchResultsView.swift */; }; 0CB0115B29D36D9E009AFEDE /* SearchResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB0115A29D36D9E009AFEDE /* SearchResultsView.swift */; };
0CB0AB5F29BD2A200015422C /* KodiServerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB0AB5E29BD2A200015422C /* KodiServerView.swift */; }; 0CB0AB5F29BD2A200015422C /* KodiServerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB0AB5E29BD2A200015422C /* KodiServerView.swift */; };
0CB6516528C5A5D700DCA721 /* InlinedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB6516428C5A5D700DCA721 /* InlinedList.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 */; }; 0CB725322C123E6F0047FC0B /* CloudDownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB725312C123E6F0047FC0B /* CloudDownloadView.swift */; };
0CB725342C123E760047FC0B /* CloudMagnetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB725332C123E760047FC0B /* CloudMagnetView.swift */; }; 0CB725342C123E760047FC0B /* CloudMagnetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB725332C123E760047FC0B /* CloudMagnetView.swift */; };
0CBAB83628D12ED500AC903E /* DisableInteraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CBAB83528D12ED500AC903E /* DisableInteraction.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 = "<group>"; }; 0CB0115A29D36D9E009AFEDE /* SearchResultsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultsView.swift; sourceTree = "<group>"; };
0CB0AB5E29BD2A200015422C /* KodiServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KodiServerView.swift; sourceTree = "<group>"; }; 0CB0AB5E29BD2A200015422C /* KodiServerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KodiServerView.swift; sourceTree = "<group>"; };
0CB6516428C5A5D700DCA721 /* InlinedList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlinedList.swift; sourceTree = "<group>"; }; 0CB6516428C5A5D700DCA721 /* InlinedList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlinedList.swift; sourceTree = "<group>"; };
0CB6516928C5B4A600DCA721 /* InlineHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlineHeader.swift; sourceTree = "<group>"; };
0CB725312C123E6F0047FC0B /* CloudDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudDownloadView.swift; sourceTree = "<group>"; }; 0CB725312C123E6F0047FC0B /* CloudDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudDownloadView.swift; sourceTree = "<group>"; };
0CB725332C123E760047FC0B /* CloudMagnetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudMagnetView.swift; sourceTree = "<group>"; }; 0CB725332C123E760047FC0B /* CloudMagnetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloudMagnetView.swift; sourceTree = "<group>"; };
0CBAB83528D12ED500AC903E /* DisableInteraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisableInteraction.swift; sourceTree = "<group>"; }; 0CBAB83528D12ED500AC903E /* DisableInteraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisableInteraction.swift; sourceTree = "<group>"; };
@ -583,7 +581,6 @@
0C44E2A928D4DFC4007711AE /* Modifiers */, 0C44E2A928D4DFC4007711AE /* Modifiers */,
0CDCB91728C662640098B513 /* EmptyInstructionView.swift */, 0CDCB91728C662640098B513 /* EmptyInstructionView.swift */,
0CA3FB1F28B91D9500FA10A8 /* IndeterminateProgressView.swift */, 0CA3FB1F28B91D9500FA10A8 /* IndeterminateProgressView.swift */,
0CB6516928C5B4A600DCA721 /* InlineHeader.swift */,
0C32FB562890D1F2002BD219 /* ListRowViews.swift */, 0C32FB562890D1F2002BD219 /* ListRowViews.swift */,
0C2D9652299316CC00A504B6 /* Tag.swift */, 0C2D9652299316CC00A504B6 /* Tag.swift */,
0C6771FB29B3E0DB005D38D2 /* HybridSecureField.swift */, 0C6771FB29B3E0DB005D38D2 /* HybridSecureField.swift */,
@ -907,7 +904,6 @@
0CA148DD288903F000DE2211 /* ScrapingViewModel.swift in Sources */, 0CA148DD288903F000DE2211 /* ScrapingViewModel.swift in Sources */,
0C445C62293F9A0B0060744D /* Bundle.swift in Sources */, 0C445C62293F9A0B0060744D /* Bundle.swift in Sources */,
0C0755C6293424A200ECA142 /* DebridLabelView.swift in Sources */, 0C0755C6293424A200ECA142 /* DebridLabelView.swift in Sources */,
0CB6516A28C5B4A600DCA721 /* InlineHeader.swift in Sources */,
0CA148D8288903F000DE2211 /* ActionChoiceView.swift in Sources */, 0CA148D8288903F000DE2211 /* ActionChoiceView.swift in Sources */,
0C41BC6528C2AEB900B47DD6 /* SearchModels.swift in Sources */, 0C41BC6528C2AEB900B47DD6 /* SearchModels.swift in Sources */,
0C68135028BC1A2D00FAD890 /* GithubWrapper.swift in Sources */, 0C68135028BC1A2D00FAD890 /* GithubWrapper.swift in Sources */,

View file

@ -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)
}
}

View file

@ -5,7 +5,6 @@
// Created by Brian Dashore on 9/4/22. // Created by Brian Dashore on 9/4/22.
// //
// Removes the top padding on unsectioned lists // Removes the top padding on unsectioned lists
// If a list is sectioned, see InlineHeader
// //
import SwiftUI import SwiftUI

View file

@ -76,7 +76,7 @@ struct HistorySectionView: View {
var body: some View { var body: some View {
if compareGroup(historyGroup) > 0 { 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(historyGroup, id: \.self) { history in
ForEach(history.entryArray.filter { allEntries.contains($0) }, id: \.self) { entry in ForEach(history.entryArray.filter { allEntries.contains($0) }, id: \.self) { entry in
HistoryButtonView(entry: entry) HistoryButtonView(entry: entry)

View file

@ -11,7 +11,7 @@ struct PluginInfoAboutView<P: Plugin>: View {
@ObservedObject var selectedPlugin: P @ObservedObject var selectedPlugin: P
var body: some View { var body: some View {
Section(header: InlineHeader("Description")) { Section("Description") {
VStack(alignment: .leading, spacing: 10) { VStack(alignment: .leading, spacing: 10) {
if let pluginAbout = selectedPlugin.about { if let pluginAbout = selectedPlugin.about {
if pluginAbout.last == "\n" { if pluginAbout.last == "\n" {

View file

@ -16,7 +16,7 @@ struct PluginInfoMetaView<P: Plugin>: View {
) var pluginLists: FetchedResults<PluginList> ) var pluginLists: FetchedResults<PluginList>
var body: some View { var body: some View {
Section(header: InlineHeader("Metadata")) { Section("Metadata") {
VStack(alignment: .leading) { VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
HStack(spacing: 5) { HStack(spacing: 5) {

View file

@ -39,7 +39,7 @@ struct PluginAggregateView<P: Plugin, PJ: PluginJson>: View {
searchText: searchText searchText: searchText
) )
if !filteredUpdatedPlugins.isEmpty { if !filteredUpdatedPlugins.isEmpty {
Section(header: InlineHeader("Updates")) { Section("Updates") {
ForEach(filteredUpdatedPlugins, id: \.self) { (updatedPlugin: PJ) in ForEach(filteredUpdatedPlugins, id: \.self) { (updatedPlugin: PJ) in
PluginCatalogButtonView(availablePlugin: updatedPlugin, needsUpdate: true) PluginCatalogButtonView(availablePlugin: updatedPlugin, needsUpdate: true)
} }
@ -47,7 +47,7 @@ struct PluginAggregateView<P: Plugin, PJ: PluginJson>: View {
} }
if !installedPlugins.isEmpty { if !installedPlugins.isEmpty {
Section(header: InlineHeader("Installed")) { Section("Installed") {
ForEach(installedPlugins, id: \.self) { installedPlugin in ForEach(installedPlugins, id: \.self) { installedPlugin in
InstalledPluginButtonView( InstalledPluginButtonView(
installedPlugin: installedPlugin, installedPlugin: installedPlugin,
@ -64,7 +64,7 @@ struct PluginAggregateView<P: Plugin, PJ: PluginJson>: View {
searchText: searchText searchText: searchText
) )
if !filteredAvailablePlugins.isEmpty { if !filteredAvailablePlugins.isEmpty {
Section(header: InlineHeader("Catalog")) { Section("Catalog") {
ForEach(filteredAvailablePlugins, id: \.self) { availablePlugin in ForEach(filteredAvailablePlugins, id: \.self) { availablePlugin in
PluginCatalogButtonView(availablePlugin: availablePlugin, needsUpdate: false) PluginCatalogButtonView(availablePlugin: availablePlugin, needsUpdate: false)
} }

View file

@ -19,7 +19,7 @@ struct SourceSettingsApiView: View {
var body: some View { var body: some View {
Section( 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.") 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 { if let clientId = selectedSourceApi.clientId, clientId.dynamic {

View file

@ -13,7 +13,7 @@ struct SourceSettingsBaseUrlView: View {
@State private var tempSite: String = "" @State private var tempSite: String = ""
var body: some View { var body: some View {
Section( Section(
header: InlineHeader("Base URL"), header: Text("Base URL"),
footer: Text("Enter the base URL of your server.") footer: Text("Enter the base URL of your server.")
) { ) {
TextField("https://...", text: $tempSite, onEditingChanged: { isFocused in TextField("https://...", text: $tempSite, onEditingChanged: { isFocused in

View file

@ -11,7 +11,7 @@ struct SourceSettingsMethodView: View {
@ObservedObject var selectedSource: Source @ObservedObject var selectedSource: Source
var body: some View { var body: some View {
Section(header: InlineHeader("Fetch method")) { Section("Fetch method") {
Picker("", selection: $selectedSource.preferredParser) { Picker("", selection: $selectedSource.preferredParser) {
if selectedSource.jsonParser != nil { if selectedSource.jsonParser != nil {
Text("Website API").tag(SourcePreferredParser.siteApi.rawValue) Text("Website API").tag(SourcePreferredParser.siteApi.rawValue)

View file

@ -29,7 +29,7 @@ struct KodiEditorView: View {
Form { Form {
Group { Group {
Section( Section(
header: InlineHeader("URL"), header: Text("URL"),
footer: Text("Must follow the format http(s)://<ip>:<port>") footer: Text("Must follow the format http(s)://<ip>:<port>")
) { ) {
TextField("Enter URL", text: $serverUrl) TextField("Enter URL", text: $serverUrl)
@ -37,14 +37,14 @@ struct KodiEditorView: View {
} }
Section( Section(
header: InlineHeader("Friendly name"), header: Text("Friendly name"),
footer: Text("Defaults to the URL if not provided") footer: Text("Defaults to the URL if not provided")
) { ) {
TextField("Friendly name", text: $friendlyName) TextField("Friendly name", text: $friendlyName)
} }
Section( Section(
header: InlineHeader("Credentials"), header: Text("Credentials"),
footer: Text("Only use for clients with authentication") footer: Text("Only use for clients with authentication")
) { ) {
TextField("Username", text: $username) TextField("Username", text: $username)

View file

@ -18,7 +18,7 @@ struct SettingsKodiView: View {
var body: some View { var body: some View {
List { List {
Section(header: InlineHeader("Description")) { Section("Description") {
VStack(alignment: .leading, spacing: 10) { VStack(alignment: .leading, spacing: 10) {
Text("Kodi is an external application that is used to manage a local media library and playback.") 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( Section(
header: InlineHeader("Servers"), header: Text("Servers"),
footer: Text("Edit a server by holding it and accessing the context menu") footer: Text("Edit a server by holding it and accessing the context menu")
) { ) {
if kodiServers.isEmpty { if kodiServers.isEmpty {

View file

@ -20,7 +20,7 @@ struct SettingsAppVersionView: View {
ProgressView() ProgressView()
} else if !releases.isEmpty { } else if !releases.isEmpty {
List { List {
Section(header: InlineHeader("GitHub links")) { Section("GitHub links") {
ForEach(releases, id: \.self) { release in ForEach(releases, id: \.self) { release in
ListRowLinkView(text: release.tagName, link: release.htmlUrl) ListRowLinkView(text: release.tagName, link: release.htmlUrl)
} }

View file

@ -16,7 +16,7 @@ struct SettingsDebridInfoView: View {
var body: some View { var body: some View {
List { List {
Section(header: InlineHeader("Description")) { Section("Description") {
VStack(alignment: .leading, spacing: 10) { VStack(alignment: .leading, spacing: 10) {
Text(debridSource.description ?? Text(debridSource.description ??
"\(debridSource.id) is a debrid service that is used for downloads and media playback. You must pay to access the service." "\(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( Section(
header: InlineHeader("Login status"), header: Text("Login status"),
footer: Text("A WebView will show up to prompt you for credentials") footer: Text("A WebView will show up to prompt you for credentials")
) { ) {
Button { Button {
@ -58,7 +58,7 @@ struct SettingsDebridInfoView: View {
} }
Section( 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!") footer: Text("Add a permanent API key here. Only use this if web authentication does not work!")
) { ) {
HybridSecureField( HybridSecureField(

View file

@ -44,13 +44,13 @@ struct SettingsView: View {
var body: some View { var body: some View {
NavigationStack { NavigationStack {
Form { Form {
Section(header: InlineHeader("Debrid services")) { Section("Debrid services") {
ForEach(debridManager.debridSources, id: \.id) { (debridSource: DebridSource) in ForEach(debridManager.debridSources, id: \.id) { (debridSource: DebridSource) in
SettingsDebridLinkView(debridSource: debridSource) SettingsDebridLinkView(debridSource: debridSource)
} }
} }
Section(header: InlineHeader("Playback services")) { Section("Playback services") {
NavigationLink { NavigationLink {
SettingsKodiView(kodiServers: kodiServers) SettingsKodiView(kodiServers: kodiServers)
} label: { } label: {
@ -64,7 +64,7 @@ struct SettingsView: View {
} }
Section( Section(
header: InlineHeader("Behavior"), header: Text("Behavior"),
footer: VStack(alignment: .leading, spacing: 8) { footer: VStack(alignment: .leading, spacing: 8) {
Text("Temporarily disable ephemeral auth if you cannot log into a service") Text("Temporarily disable ephemeral auth if you cannot log into a service")
Text("Only disable search timeout if results are slow to fetch") 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") { NavigationLink("Plugin lists") {
SettingsPluginListView() SettingsPluginListView()
} }
} }
Section(header: InlineHeader("Default actions")) { Section("Default actions") {
if !debridManager.enabledDebrids.isEmpty { if !debridManager.enabledDebrids.isEmpty {
NavigationLink { NavigationLink {
DefaultActionPickerView( DefaultActionPickerView(
@ -175,13 +175,13 @@ struct SettingsView: View {
} }
} }
Section(header: InlineHeader("Backups")) { Section("Backups") {
NavigationLink("Backups") { NavigationLink("Backups") {
BackupsView() BackupsView()
} }
} }
Section(header: InlineHeader("Updates")) { Section("Updates") {
Toggle(isOn: $autoUpdateNotifs) { Toggle(isOn: $autoUpdateNotifs) {
Text("Show update alerts") 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: "Donate", link: "https://ko-fi.com/kingbri")
ListRowLinkView(text: "Report issues", link: "https://github.com/bdashore3/Ferrite/issues") 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") { NavigationLink("Logs") {
SettingsLogView() SettingsLogView()
} }

View file

@ -31,7 +31,7 @@ struct ActionChoiceView: View {
var body: some View { var body: some View {
NavigationStack { NavigationStack {
Form { Form {
Section(header: InlineHeader("Now Playing")) { Section("Now Playing") {
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text(navModel.selectedTitle) Text(navModel.selectedTitle)
.font(.callout) .font(.callout)
@ -46,7 +46,7 @@ struct ActionChoiceView: View {
} }
if !debridManager.downloadUrl.isEmpty { if !debridManager.downloadUrl.isEmpty {
Section(header: InlineHeader("Debrid options")) { Section("Debrid options") {
ForEach(actions, id: \.id) { action in ForEach(actions, id: \.id) { action in
if action.requires.contains(ActionRequirement.debrid.rawValue) { if action.requires.contains(ActionRequirement.debrid.rawValue) {
ListRowButtonView(action.name, systemImage: "arrow.up.forward.app.fill") { ListRowButtonView(action.name, systemImage: "arrow.up.forward.app.fill") {
@ -91,7 +91,7 @@ struct ActionChoiceView: View {
} }
if !navModel.resultFromCloud { if !navModel.resultFromCloud {
Section(header: InlineHeader("Magnet options")) { Section("Magnet options") {
ForEach(actions, id: \.id) { action in ForEach(actions, id: \.id) { action in
if action.requires.contains(ActionRequirement.magnet.rawValue) { if action.requires.contains(ActionRequirement.magnet.rawValue) {
ListRowButtonView(action.name, systemImage: "arrow.up.forward.app.fill") { ListRowButtonView(action.name, systemImage: "arrow.up.forward.app.fill") {