mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 11:43:24 +01:00
AppIconsView: Add artists
This commit is contained in:
@@ -27,6 +27,11 @@ struct AppIconsView: View {
|
|||||||
SpecialIcon(assetName: "Starburst", suffix: "(Beta)", forceIndex: 1),
|
SpecialIcon(assetName: "Starburst", suffix: "(Beta)", forceIndex: 1),
|
||||||
SpecialIcon(assetName: "Steel", suffix: "(Nightly)", forceIndex: 2),
|
SpecialIcon(assetName: "Steel", suffix: "(Nightly)", forceIndex: 2),
|
||||||
]
|
]
|
||||||
|
private let artists = [
|
||||||
|
"Chris (LitRitt)": ["Neon", "Starburst", "Steel", "Storm"],
|
||||||
|
"naturecodevoid": ["Honeydew", "Midnight", "Sky"]
|
||||||
|
]
|
||||||
|
|
||||||
private var icons: [Icon] = []
|
private var icons: [Icon] = []
|
||||||
private var primaryIcon: Icon
|
private var primaryIcon: Icon
|
||||||
|
|
||||||
@@ -70,7 +75,6 @@ struct AppIconsView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List(icons, selection: $selectedIcon) { icon in
|
List(icons, selection: $selectedIcon) { icon in
|
||||||
// FIXME: Button gives errors for some reason
|
|
||||||
SwiftUI.Button(action: {
|
SwiftUI.Button(action: {
|
||||||
selectedIconAssetName = icon.assetName
|
selectedIconAssetName = icon.assetName
|
||||||
// Pass nil for primary icon
|
// Pass nil for primary icon
|
||||||
@@ -89,14 +93,20 @@ struct AppIconsView: View {
|
|||||||
.renderingMode(.original)
|
.renderingMode(.original)
|
||||||
.cornerRadius(12.6) // https://stackoverflow.com/a/10239376
|
.cornerRadius(12.6) // https://stackoverflow.com/a/10239376
|
||||||
.frame(width: 72, height: 72)
|
.frame(width: 72, height: 72)
|
||||||
Text(icon.displayName)
|
VStack(alignment: .leading) {
|
||||||
|
Text(icon.displayName)
|
||||||
|
if let artist = artists.first(where: { $0.value.contains(icon.assetName) }) {
|
||||||
|
Text("By " + artist.key)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
}
|
||||||
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
if selectedIconAssetName == icon.assetName {
|
if selectedIconAssetName == icon.assetName {
|
||||||
Image(systemSymbol: .checkmark)
|
Image(systemSymbol: .checkmark)
|
||||||
.foregroundColor(Color.blue)
|
.foregroundColor(Color.blue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.foregroundColor(Color.white)
|
}.foregroundColor(.primary)
|
||||||
}
|
}
|
||||||
.navigationTitle(L10n.AppIconsView.title)
|
.navigationTitle(L10n.AppIconsView.title)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user