Tusker/Packages/TuskerPreferences/Sources/TuskerPreferences/Keys/AppearanceKeys.swift

50 lines
1.4 KiB
Swift
Raw Normal View History

2024-04-13 22:44:43 +00:00
//
// AppearanceKeys.swift
// TuskerPreferences
//
// Created by Shadowfacts on 4/13/24.
//
import Foundation
import UIKit
public struct ThemeKey: MigratablePreferenceKey {
public static var defaultValue: Theme { .unspecified }
2024-04-13 22:44:43 +00:00
}
public struct AccentColorKey: MigratablePreferenceKey {
public static var defaultValue: AccentColor { .default }
2024-04-13 22:44:43 +00:00
}
2024-04-15 14:37:02 +00:00
struct AvatarStyleKey: MigratablePreferenceKey {
2024-04-13 22:44:43 +00:00
static var defaultValue: AvatarStyle { .roundRect }
}
2024-04-15 14:37:02 +00:00
struct LeadingSwipeActionsKey: MigratablePreferenceKey {
2024-04-13 22:44:43 +00:00
static var defaultValue: [StatusSwipeAction] { [.favorite, .reblog] }
}
2024-04-15 14:37:02 +00:00
struct TrailingSwipeActionsKey: MigratablePreferenceKey {
2024-04-13 22:44:43 +00:00
static var defaultValue: [StatusSwipeAction] { [.reply, .share] }
}
public struct WidescreenNavigationModeKey: MigratablePreferenceKey {
public static var defaultValue: WidescreenNavigationMode { .multiColumn }
public static func shouldMigrate(oldValue: WidescreenNavigationMode) -> Bool {
oldValue != .splitScreen
}
2024-04-13 22:44:43 +00:00
}
2024-04-15 14:37:02 +00:00
struct AttachmentBlurModeKey: MigratablePreferenceKey {
static var defaultValue: AttachmentBlurMode { .useStatusSetting }
static func didSet(in store: PreferenceStore, newValue: AttachmentBlurMode) {
if newValue == .always {
store.blurMediaBehindContentWarning = true
} else if newValue == .never {
store.blurMediaBehindContentWarning = false
}
}
}