[CHANGE] Replace system image name strings with SFSymbols

This commit is contained in:
Fabian Thies
2022-12-23 15:21:16 +01:00
committed by Joe Mattiello
parent bcd54067d3
commit 5697c4c063
13 changed files with 95 additions and 52 deletions

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
import AltStoreCore
struct AppPermissionsGrid: View {
@@ -34,7 +35,7 @@ struct AppPermissionGridItemView: View {
self.isPopoverPresented = true
} label: {
VStack {
Image(uiImage: (permission.type.icon?.withRenderingMode(.alwaysTemplate) ?? UIImage(systemName: "questionmark"))!) // TODO: Replace with system icon
Image(uiImage: permission.type.icon ?? UIImage(systemSymbol: .questionmark))
.padding()
.background(Circle().foregroundColor(Color(.secondarySystemBackground)))
Text(permission.type.localizedShortName ?? permission.type.localizedName ?? "")

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
struct AddSourceView: View {
@@ -28,7 +29,7 @@ struct AddSourceView: View {
Text("Please enter the source url here. Then, tap continue to validate and add the source in the next step.")
HStack(alignment: .top) {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemSymbol: .exclamationmarkTriangleFill)
Text("Be careful with unvalidated third-party sources! Make sure to only add sources that you trust.")
}

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
import AltStoreCore
struct BrowseView: View {
@@ -76,7 +77,7 @@ struct BrowseView: View {
SwiftUI.Button {
} label: {
Image(systemName: "line.3.horizontal.decrease.circle")
Image(systemSymbol: .lineHorizontal3DecreaseCircle)
.imageScale(.large)
}
@@ -127,7 +128,7 @@ struct PromotedCategoryView: View {
}
HStack {
Image(systemName: "dpad.right.filled")
Image(systemSymbol: .dpadRightFill)
Text("Games &\nEmulators")
.multilineTextAlignment(.leading)
}

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
import AltStoreCore
struct ConfirmAddSourceView: View {
@@ -64,7 +65,7 @@ struct ConfirmAddSourceView: View {
SwiftUI.Button {
confirmationHandler(fetchedSource)
} label: {
Label(title: { Text("Add Source") }, icon: { Image(systemName: "plus") })
Label("Add Source", systemSymbol: .plus)
}
.buttonStyle(FilledButtonStyle())
.padding()
@@ -75,7 +76,7 @@ struct ConfirmAddSourceView: View {
SwiftUI.Button {
} label: {
Image(systemName: "xmark.circle.fill")
Image(systemSymbol: .xmarkCircleFill)
.foregroundColor(.secondary)
}

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
import AltStoreCore
import CoreData
@@ -57,7 +58,7 @@ struct SourcesView: View {
SwiftUI.Button {
self.removeSource(source)
} label: {
Label("Remove", systemImage: "trash")
Label("Remove", systemSymbol: .trash)
}
}))
}
@@ -85,7 +86,7 @@ struct SourcesView: View {
SwiftUI.Button {
self.isShowingAddSourceAlert = true
} label: {
Image(systemName: "plus")
Image(systemSymbol: .plus)
}
.sheet(isPresented: self.$isShowingAddSourceAlert) {
NavigationView {

View File

@@ -7,6 +7,7 @@
//
import Foundation
import SFSafeSymbols
enum AppAction: Int, CaseIterable {
case install, open, refresh
@@ -34,20 +35,20 @@ enum AppAction: Int, CaseIterable {
}
}
var imageName: String {
var symbol: SFSymbol {
switch self {
case .install: return "Install"
case .open: return "arrow.up.forward.app"
case .refresh: return "arrow.clockwise"
case .activate: return "checkmark.circle"
case .deactivate: return "xmark.circle"
case .remove: return "trash"
case .enableJIT: return "bolt"
case .backup: return "doc.on.doc"
case .exportBackup: return "arrow.up.doc"
case .restoreBackup: return "arrow.down.doc"
case .chooseCustomIcon: return "photo"
case .resetCustomIcon: return "arrow.uturn.left"
case .install: return .squareAndArrowDown
case .open: return .arrowUpForwardApp
case .refresh: return .arrowClockwise
case .activate: return .checkmarkCircle
case .deactivate: return .xmarkCircle
case .remove: return .trash
case .enableJIT: return .bolt
case .backup: return .docOnDoc
case .exportBackup: return .arrowUpDoc
case .restoreBackup: return .arrowDownDoc
case .chooseCustomIcon: return .photo
case .resetCustomIcon: return .arrowUturnLeft
}
}
}

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
import MobileCoreServices
import AltStoreCore
@@ -119,7 +120,7 @@ struct MyAppsView: View {
SwiftUI.Button {
self.isShowingFilePicker = true
} label: {
Image(systemName: "plus")
Image(systemSymbol: .plus)
.imageScale(.large)
}
.sheet(isPresented: self.$isShowingFilePicker) {
@@ -157,7 +158,7 @@ struct MyAppsView: View {
SwiftUI.Button {
self.perform(action: action, for: app)
} label: {
Label(action.title, systemImage: action.imageName)
Label(action.title, systemSymbol: action.symbol)
}
}
}))

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import SFSafeSymbols
struct RootView: View {
@@ -78,12 +79,12 @@ extension RootView {
static var defaultTab: RootView.Tab = .news
var displaySymbol: String {
var displaySymbol: SFSymbol {
switch self {
case .news: return "newspaper"
case .browse: return "app.dashed"
case .myApps: return "app.badge"
case .settings: return "gearshape"
case .news: return .newspaper
case .browse: return .booksVertical
case .myApps: return .appBadge
case .settings: return .gearshape
}
}
@@ -97,7 +98,7 @@ extension RootView {
}
var label: some View {
Label(self.displayName, systemImage: self.displaySymbol)
Label(self.displayName, systemSymbol: self.displaySymbol)
}
}
}

View File

@@ -8,6 +8,7 @@
import SwiftUI
import AsyncImage
import SFSafeSymbols
import AltStoreCore
import Intents
@@ -149,7 +150,7 @@ struct SettingsView: View {
SwiftUI.Button {
} label: {
Image(systemName: "person.crop.circle")
Image(systemSymbol: .personCropCircle)
.imageScale(.large)
}