mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Working button remapping
This commit is contained in:
parent
9f57cc0a38
commit
40bcbb1c7f
6 changed files with 124 additions and 32 deletions
|
|
@ -196,6 +196,28 @@ enum ProgressBarStyle: String, CaseIterable, Identifiable, Defaults.Serializable
|
|||
var id: String { self.rawValue }
|
||||
}
|
||||
|
||||
enum MusicAuxiliaryControl: String, CaseIterable, Identifiable, Defaults.Serializable {
|
||||
case shuffle
|
||||
case repeatMode
|
||||
case mediaOutput
|
||||
case lyrics
|
||||
|
||||
var id: String { rawValue }
|
||||
|
||||
var displayName: String {
|
||||
switch self {
|
||||
case .shuffle:
|
||||
return "Shuffle"
|
||||
case .repeatMode:
|
||||
return "Repeat"
|
||||
case .mediaOutput:
|
||||
return "Media Output"
|
||||
case .lyrics:
|
||||
return "Lyrics Toggle"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum TimerIconColorMode: String, CaseIterable, Identifiable, Defaults.Serializable {
|
||||
case adaptive = "Adaptive"
|
||||
case solid = "Solid"
|
||||
|
|
@ -372,6 +394,9 @@ extension Defaults.Keys {
|
|||
static let waitInterval = Key<Double>("waitInterval", default: 3)
|
||||
static let showShuffleAndRepeat = Key<Bool>("showShuffleAndRepeat", default: false)
|
||||
static let showMediaOutputControl = Key<Bool>("showMediaOutputControl", default: false)
|
||||
static let musicAuxLeftControl = Key<MusicAuxiliaryControl>("musicAuxLeftControl", default: .shuffle)
|
||||
static let musicAuxRightControl = Key<MusicAuxiliaryControl>("musicAuxRightControl", default: .repeatMode)
|
||||
static let didMigrateMusicAuxControls = Key<Bool>("didMigrateMusicAuxControls", default: false)
|
||||
// Enable lock screen media widget (shows the standalone panel when screen is locked)
|
||||
static let enableLockScreenMediaWidget = Key<Bool>("enableLockScreenMediaWidget", default: true)
|
||||
static let enableLockScreenWeatherWidget = Key<Bool>("enableLockScreenWeatherWidget", default: true)
|
||||
|
|
@ -552,4 +577,14 @@ extension Defaults.Keys {
|
|||
Defaults[.progressBarStyle] = .gradient
|
||||
}
|
||||
}
|
||||
|
||||
static func migrateMusicAuxControls() {
|
||||
guard Defaults[.didMigrateMusicAuxControls] == false else { return }
|
||||
|
||||
if Defaults[.showMediaOutputControl] {
|
||||
Defaults[.musicAuxRightControl] = .mediaOutput
|
||||
}
|
||||
|
||||
Defaults[.didMigrateMusicAuxControls] = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue