mirror of
https://github.com/yattee/yattee.git
synced 2026-06-10 00:34:19 +00:00
Use user-selected accent color in Home, Subscriptions, and Downloads
Color.accentColor and .foregroundStyle(.tint) resolve to the asset catalog accent on macOS, so Home shortcut cards, section header links, the Subscriptions "All channels" header, and the Downloads per-channel group headers stayed blue when the user picked a different accent. Read the color from SettingsManager and apply it directly, matching the pattern already used for the Play button.
This commit is contained in:
@@ -8,11 +8,16 @@
|
||||
import SwiftUI
|
||||
|
||||
struct HomeShortcutCardView<StatusIndicator: View>: View {
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
|
||||
#if os(tvOS)
|
||||
@Environment(\.isFocused) private var isFocused
|
||||
#endif
|
||||
|
||||
private var accentColor: Color {
|
||||
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
|
||||
}
|
||||
|
||||
let icon: String
|
||||
let title: String
|
||||
let count: Int
|
||||
@@ -76,7 +81,7 @@ struct HomeShortcutCardView<StatusIndicator: View>: View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Image(systemName: icon)
|
||||
.font(.title3)
|
||||
.foregroundStyle(.tint)
|
||||
.foregroundStyle(accentColor)
|
||||
.frame(width: iconSize)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
@@ -102,7 +107,7 @@ struct HomeShortcutCardView<StatusIndicator: View>: View {
|
||||
HStack(alignment: .center, spacing: 8) {
|
||||
Image(systemName: icon)
|
||||
.font(.title3)
|
||||
.foregroundStyle(.tint)
|
||||
.foregroundStyle(accentColor)
|
||||
.frame(width: iconSize)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
@@ -136,7 +141,7 @@ struct HomeShortcutCardView<StatusIndicator: View>: View {
|
||||
.background(cardBackground)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: cornerRadius)
|
||||
.strokeBorder(Color.accentColor.opacity(0.3), lineWidth: 1)
|
||||
.strokeBorder(accentColor.opacity(0.3), lineWidth: 1)
|
||||
)
|
||||
.clipShape(RoundedRectangle(cornerRadius: cornerRadius))
|
||||
}
|
||||
@@ -159,7 +164,7 @@ struct HomeShortcutCardView<StatusIndicator: View>: View {
|
||||
#if os(tvOS)
|
||||
isFocused ? Color.white.opacity(0.2) : Color.gray.opacity(0.3)
|
||||
#else
|
||||
Color.accentColor.opacity(0.1)
|
||||
accentColor.opacity(0.1)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user