Skip to content

Commit

Permalink
refactor: use symbolVariant where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
vapidinfinity committed Nov 10, 2024
1 parent 619c395 commit 7a01c71
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3082;
CURRENT_PROJECT_VERSION = 3083;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down Expand Up @@ -820,7 +820,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3082;
CURRENT_PROJECT_VERSION = 3083;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Navigation/AccountsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ struct AccountsView: View {
isAuthViewPresented = true
}
} label: {
Image(systemName: signedIn ? "person.slash" : "person")
Image(systemName: "person")
.symbolVariant(signedIn ? .slash : .none)
.foregroundStyle(isHoveringOverDestructiveEpicButton ? .red : .primary)
.padding(5)

Expand Down
13 changes: 4 additions & 9 deletions Mythic/Views/Navigation/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,16 @@ struct ContentView: View {
Section {
NavigationLink(destination: HomeView()) {
Label("Home", systemImage: "house")
// .foregroundStyle(.primary)
.help("Everything in one place")
}

NavigationLink(destination: LibraryView()) {
Label("Library", systemImage: "books.vertical")
// .foregroundStyle(.primary)
.help("View your games")
}

NavigationLink(destination: StoreView()) {
Label("Store", systemImage: "basket")
// .foregroundStyle(.primary)
.help("Purchase new games from Epic")
}
} header: {
Expand All @@ -72,25 +69,21 @@ struct ContentView: View {
Section {
NavigationLink(destination: ContainersView()) {
Label("Containers", systemImage: "cube")
// .foregroundStyle(.primary)
.help("Manage containers for Windows® applications")
}

NavigationLink(destination: SettingsView()) {
Label("Settings", systemImage: "gear")
// .foregroundStyle(.primary)
.help("Configure Mythic")
}

NavigationLink(destination: SupportView()) {
Label("Support", systemImage: "questionmark.bubble")
// .foregroundStyle(.primary)
.help("Get support/Support Mythic")
}

NavigationLink(destination: AccountsView()) {
Label("Accounts", systemImage: "person.2")
// .foregroundStyle(.primary)
.help("View all currently signed in accounts")
}
} header: {
Expand All @@ -107,15 +100,17 @@ struct ContentView: View {
if !networkMonitor.isEpicAccessible {
ToolbarItem(placement: .navigation) {
if networkMonitor.isCheckingEpicAccessibility {
Image(systemName: "network.slash")
Image(systemName: "network")
.symbolVariant(.slash)
.symbolEffect(.pulse)
.help("Mythic is checking the connection to Epic.")
} else if networkMonitor.isConnected {
Image(systemName: "wifi.exclamationmark")
.symbolEffect(.pulse)
.help("Mythic is connected to the internet, but cannot establish a connection to Epic.")
} else {
Image(systemName: "network.slash")
Image(systemName: "network")
.symbolVariant(.slash)
.help("Mythic is not connected to the internet.")
}
}
Expand Down
4 changes: 3 additions & 1 deletion Mythic/Views/Navigation/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ struct HomeView: View {
}
} else {
HStack {
Image(systemName: "star.fill")
Image(systemName: "star")
.symbolVariant(.fill)

Text("No games are favourited.")
}
}
Expand Down
6 changes: 4 additions & 2 deletions Mythic/Views/Navigation/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ struct SettingsView: View {
Spacer()

if !FileLocations.isWritableFolder(url: installBaseURL) {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.help("Folder is not writable.")
}

Expand Down Expand Up @@ -202,7 +203,8 @@ struct SettingsView: View {
isShaderCachePurgeSuccessful = Wine.purgeShaderCache()
}
} label: {
Label("Purge Shader Cache", systemImage: "square.stack.3d.up.slash.fill")
Label("Purge Shader Cache", systemImage: "square.stack.3d.up.slash")
.symbolVariant(.slash.fill)
}

if isShaderCachePurgeSuccessful != nil {
Expand Down
9 changes: 6 additions & 3 deletions Mythic/Views/Navigation/StoreView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ struct StoreView: View {
url = .init(string: "javascript:history.back();")!
}
} label: {
Image(systemName: "arrow.left.circle")
Image(systemName: "arrow.left")
.symbolVariant(.circle)
}
.disabled(!canGoBack)
}
Expand All @@ -76,7 +77,8 @@ struct StoreView: View {
url = .init(string: "javascript:history.forward();")!
}
} label: {
Image(systemName: "arrow.right.circle")
Image(systemName: "arrow.right")
.symbolVariant(.circle)
}
.disabled(!canGoForward)
}
Expand All @@ -90,7 +92,8 @@ struct StoreView: View {
refreshAnimation = .degrees(0)
}
} label: {
Image(systemName: "arrow.clockwise.circle")
Image(systemName: "arrow.clockwise")
.symbolVariant(.circle)
.rotationEffect(refreshAnimation) // thx whisky
}
}
Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/OnboardingViewR2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,9 @@ extension OnboardingR2 {
switch thirdRow[index] {
case .help(let content):
Button { isHelpPopoverPresented = true } label: {
Image(systemName: "questionmark.circle")
Image(systemName: "questionmark")
.resizable()
.symbolVariant(.circle)
.scaledToFit()
.frame(width: 20)
}
Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Unified/Modules/CompactGameCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ struct CompactGameCard: View {
}
.overlay(alignment: .topLeading) {
if game.isFavourited {
Image(systemName: "star.fill")
Image(systemName: "star")
.symbolVariant(.fill)
.foregroundStyle(isImageEmpty ? Color.primary : Color.white)
.padding()
}
Expand Down
10 changes: 8 additions & 2 deletions Mythic/Views/Unified/Modules/DownloadCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,17 @@ struct DownloadCard: View {
case .failure:
RoundedRectangle(cornerRadius: 20)
.fill(.windowBackground)
.overlay { Image(systemName: "exclamationmark.triangle.fill") }
.overlay {
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
}
@unknown default:
RoundedRectangle(cornerRadius: 20)
.fill(.windowBackground)
.overlay { Image(systemName: "questionmark.circle.fill") }
.overlay {
Image(systemName: "questionmark.circle")
.symbolVariant(.fill)
}
}
}
.ignoresSafeArea()
Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Unified/Modules/GameImport/EpicImport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ extension GameImportView {
Spacer()

if !files.isReadableFile(atPath: path) {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.help("File/Folder is not readable by Mythic.")
}

Expand Down
6 changes: 4 additions & 2 deletions Mythic/Views/Unified/Modules/GameImport/LocalImport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ extension GameImportView {
VStack {
GameCard.ImageCard(game: $game, isImageEmpty: $isImageEmpty)

Label("Images with a 3:4 aspect ratio fit the best.", systemImage: "info.circle")
Label("Images with a 3:4 aspect ratio fit the best.", systemImage: "info")
.symbolVariant(.circle)
.font(.footnote)
.foregroundStyle(.placeholder)
}
Expand Down Expand Up @@ -111,7 +112,8 @@ extension GameImportView {
}

if !files.isReadableFile(atPath: path), !path.isEmpty {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.help("File/Folder is not readable by Mythic.")
}

Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Unified/Sheets/ContainerCreationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ struct ContainerCreationView: View {
Spacer()

if !FileLocations.isWritableFolder(url: containerURL) {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.help("Folder is not writable.")
}

Expand Down
6 changes: 4 additions & 2 deletions Mythic/Views/Unified/Sheets/ContainerSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ struct ContainerSettingsView: View {
ProgressView()
.controlSize(.small)
} else {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.controlSize(.small)
.help("Retina Mode cannot be modified: \(retinaModeError?.localizedDescription ?? "Unknown Error.")")
}
Expand Down Expand Up @@ -153,7 +154,8 @@ struct ContainerSettingsView: View {
ProgressView()
.controlSize(.small)
} else {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.controlSize(.small)
.help("Windows version cannot be modified: \(retinaModeError?.localizedDescription ?? "Unknown Error.")")
}
Expand Down
6 changes: 4 additions & 2 deletions Mythic/Views/Unified/Sheets/GameSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,17 @@ private extension GameSettingsView {
RoundedRectangle(cornerRadius: 20)
.fill(.windowBackground)
.overlay {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
}
}

var unknownThumbnailPlaceholder: some View {
RoundedRectangle(cornerRadius: 20)
.fill(.windowBackground)
.overlay {
Image(systemName: "questionmark.circle.fill")
Image(systemName: "questionmark.circle")
.symbolVariant(.fill)
}
}

Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Unified/Sheets/InstallGameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ struct InstallViewEvo: View {
Spacer()

if !FileLocations.isWritableFolder(url: baseURL) {
Image(systemName: "exclamationmark.triangle.fill")
Image(systemName: "exclamationmark.triangle")
.symbolVariant(.fill)
.help("Folder is not writable.")
}

Expand Down

0 comments on commit 7a01c71

Please sign in to comment.