forked from shadowfacts/Tusker
50 lines
1.4 KiB
Swift
50 lines
1.4 KiB
Swift
//
|
|
// AppearanceKeys.swift
|
|
// TuskerPreferences
|
|
//
|
|
// Created by Shadowfacts on 4/13/24.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
public struct ThemeKey: MigratablePreferenceKey {
|
|
public static var defaultValue: Theme { .unspecified }
|
|
}
|
|
|
|
public struct AccentColorKey: MigratablePreferenceKey {
|
|
public static var defaultValue: AccentColor { .default }
|
|
}
|
|
|
|
struct AvatarStyleKey: MigratablePreferenceKey {
|
|
static var defaultValue: AvatarStyle { .roundRect }
|
|
}
|
|
|
|
struct LeadingSwipeActionsKey: MigratablePreferenceKey {
|
|
static var defaultValue: [StatusSwipeAction] { [.favorite, .reblog] }
|
|
}
|
|
|
|
struct TrailingSwipeActionsKey: MigratablePreferenceKey {
|
|
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
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|