| | |
| | | @AppStorage("showUncommonAppBubbles") private var showUncommonAppBubbles = AppDefaults.showUncommonAppBubbles |
| | | @AppStorage("hideUsageTips") private var hideUsageTips = AppDefaults.hideUsageTips |
| | | @AppStorage(AppGridTheme.storageKey) private var appGridThemeID = AppDefaults.appGridThemeID |
| | | @AppStorage(AppGridTheme.deepBlueTuningStorageKey) private var deepBlueThemeTuning = AppGridTheme.deepBlue.defaultColorTuning |
| | | @AppStorage(AppGridTheme.colorfulTuningStorageKey) private var colorfulThemeTuning = AppGridTheme.colorful.defaultColorTuning |
| | | @AppStorage("useAppKitTagNavigation") private var useAppKitTagNavigation = AppDefaults.useAppKitTagNavigation |
| | | @AppStorage("skipTagRemovalDropConfirm") private var skipTagRemovalDropConfirm = false |
| | | @AppStorage("skipUncategorizedDropConfirm") private var skipUncategorizedDropConfirm = false |
| | |
| | | editPhase == .none |
| | | ? ProEntitlementPolicy.effectiveTheme(for: appGridTheme) |
| | | : .defaultLight |
| | | } |
| | | |
| | | private var renderedAppGridThemeTuning: Double? { |
| | | guard editPhase == .none else { return nil } |
| | | return ProEntitlementPolicy.effectiveThemeTuning( |
| | | for: appGridTheme, |
| | | storedTuning: storedThemeTuning(for: appGridTheme) |
| | | ) |
| | | } |
| | | |
| | | private func storedThemeTuning(for theme: AppGridTheme) -> Double? { |
| | | switch theme { |
| | | case .deepBlue: |
| | | return deepBlueThemeTuning |
| | | case .colorful: |
| | | return colorfulThemeTuning |
| | | case .defaultLight, .black, .pink, .purple, .green, .blue: |
| | | return nil |
| | | } |
| | | } |
| | | |
| | | private var isSideLayout: Bool { |
| | |
| | | |
| | | private var appGridBackground: some View { |
| | | let theme = renderedAppGridTheme |
| | | let tuning = renderedAppGridThemeTuning |
| | | return ZStack { |
| | | if theme.usesVisualEffectBackdrop { |
| | | VisualEffectView( |
| | |
| | | } |
| | | if !theme.isDefaultLight { |
| | | LinearGradient( |
| | | colors: theme.backgroundBaseColors, |
| | | colors: theme.backgroundBaseColors(tuning: tuning), |
| | | startPoint: .topLeading, |
| | | endPoint: .bottomTrailing |
| | | ) |
| | | LinearGradient( |
| | | colors: theme.backgroundAccentColors, |
| | | colors: theme.backgroundAccentColors(tuning: tuning), |
| | | startPoint: .topTrailing, |
| | | endPoint: .bottomLeading |
| | | ) |