mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Update Remappable behaviour enhancement
This commit is contained in:
parent
96dde9d555
commit
e5433c28d5
5 changed files with 35 additions and 29 deletions
|
|
@ -2838,10 +2838,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Allow media output control in layouts" : {
|
|
||||||
"comment" : "A toggle that enables media output control in layouts.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"ALPHA" : {
|
"ALPHA" : {
|
||||||
"comment" : "A label indicating a feature that is still in development.",
|
"comment" : "A label indicating a feature that is still in development.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
|
|
@ -8878,6 +8874,10 @@
|
||||||
},
|
},
|
||||||
"Fit to Notch" : {
|
"Fit to Notch" : {
|
||||||
|
|
||||||
|
},
|
||||||
|
"Floating window panel skip behaviour" : {
|
||||||
|
"comment" : "A section header that describes the floating window panel's skip behaviour settings.",
|
||||||
|
"isCommentAutoGenerated" : true
|
||||||
},
|
},
|
||||||
"Focus active: %@" : {
|
"Focus active: %@" : {
|
||||||
"comment" : "An accessibility label for the focus widget, describing the currently active focus mode.",
|
"comment" : "An accessibility label for the focus widget, describing the currently active focus mode.",
|
||||||
|
|
@ -17497,6 +17497,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Show sneak peek on playback changes" : {
|
||||||
|
"comment" : "A toggle that enables showing sneak peek when the currently playing track changes.",
|
||||||
|
"isCommentAutoGenerated" : true
|
||||||
|
},
|
||||||
"Show the active Focus name inside the indicator." : {
|
"Show the active Focus name inside the indicator." : {
|
||||||
"comment" : "A description of why the \"Show Focus Label\" toggle is disabled when the \"Show Focus as brief toast\" toggle is enabled.",
|
"comment" : "A description of why the \"Show Focus Label\" toggle is disabled when the \"Show Focus as brief toast\" toggle is enabled.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
|
|
@ -17530,10 +17534,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Skip behaviour" : {
|
|
||||||
"comment" : "A section header that describes the skip behaviour settings.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Skip buttons" : {
|
"Skip buttons" : {
|
||||||
"comment" : "A section header that lists the skip behaviour options.",
|
"comment" : "A section header that lists the skip behaviour options.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,8 @@ struct MusicSlotConfigurationView: View {
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
.frame(width: 72)
|
.frame(width: 72)
|
||||||
|
.lineLimit(1)
|
||||||
|
.minimumScaleFactor(0.8)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
}
|
}
|
||||||
.opacity(control == .mediaOutput && !showMediaOutputControl ? 0.4 : 1)
|
.opacity(control == .mediaOutput && !showMediaOutputControl ? 0.4 : 1)
|
||||||
|
|
|
||||||
|
|
@ -1363,6 +1363,7 @@ struct Media: View {
|
||||||
@Default(.musicSkipBehavior) private var musicSkipBehavior
|
@Default(.musicSkipBehavior) private var musicSkipBehavior
|
||||||
@Default(.musicControlWindowEnabled) private var musicControlWindowEnabled
|
@Default(.musicControlWindowEnabled) private var musicControlWindowEnabled
|
||||||
@Default(.enableLockScreenMediaWidget) private var enableLockScreenMediaWidget
|
@Default(.enableLockScreenMediaWidget) private var enableLockScreenMediaWidget
|
||||||
|
@Default(.showSneakPeekOnTrackChange) private var showSneakPeekOnTrackChange
|
||||||
|
|
||||||
private func highlightID(_ title: String) -> String {
|
private func highlightID(_ title: String) -> String {
|
||||||
SettingsTab.media.highlightID(for: title)
|
SettingsTab.media.highlightID(for: title)
|
||||||
|
|
@ -1408,10 +1409,6 @@ struct Media: View {
|
||||||
customBadge(text: "Beta")
|
customBadge(text: "Beta")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Defaults.Toggle(key: .showMediaOutputControl) {
|
|
||||||
Text("Allow media output control in layouts")
|
|
||||||
}
|
|
||||||
.disabled(!showShuffleAndRepeat)
|
|
||||||
if showShuffleAndRepeat {
|
if showShuffleAndRepeat {
|
||||||
MusicSlotConfigurationView()
|
MusicSlotConfigurationView()
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1423,6 +1420,7 @@ struct Media: View {
|
||||||
} header: {
|
} header: {
|
||||||
Text("Media controls")
|
Text("Media controls")
|
||||||
}
|
}
|
||||||
|
if musicControlWindowEnabled {
|
||||||
Section {
|
Section {
|
||||||
Picker("Skip buttons", selection: $musicSkipBehavior) {
|
Picker("Skip buttons", selection: $musicSkipBehavior) {
|
||||||
ForEach(MusicSkipBehavior.allCases) { behavior in
|
ForEach(MusicSkipBehavior.allCases) { behavior in
|
||||||
|
|
@ -1436,7 +1434,8 @@ struct Media: View {
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
} header: {
|
} header: {
|
||||||
Text("Skip behaviour")
|
Text("Floating window panel skip behaviour")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Section {
|
Section {
|
||||||
Toggle(
|
Toggle(
|
||||||
|
|
@ -1450,6 +1449,8 @@ struct Media: View {
|
||||||
.disabled(!coordinator.musicLiveActivityEnabled)
|
.disabled(!coordinator.musicLiveActivityEnabled)
|
||||||
.help("Displays play/pause and skip buttons beside the notch while music is active. Disabled by default.")
|
.help("Displays play/pause and skip buttons beside the notch while music is active. Disabled by default.")
|
||||||
Toggle("Enable sneak peek", isOn: $enableSneakPeek)
|
Toggle("Enable sneak peek", isOn: $enableSneakPeek)
|
||||||
|
Toggle("Show sneak peek on playback changes", isOn: $showSneakPeekOnTrackChange)
|
||||||
|
.disabled(!enableSneakPeek)
|
||||||
Defaults.Toggle("Enable lyrics", key: .enableLyrics)
|
Defaults.Toggle("Enable lyrics", key: .enableLyrics)
|
||||||
.settingsHighlight(id: highlightID("Enable lyrics"))
|
.settingsHighlight(id: highlightID("Enable lyrics"))
|
||||||
Picker("Sneak Peek Style", selection: $sneakPeekStyles){
|
Picker("Sneak Peek Style", selection: $sneakPeekStyles){
|
||||||
|
|
|
||||||
|
|
@ -220,13 +220,13 @@ class MusicManager: ObservableObject {
|
||||||
if eventIsPlaying != self.isPlaying {
|
if eventIsPlaying != self.isPlaying {
|
||||||
let animation: Animation? = (expectedState == eventIsPlaying) ? .smooth(duration: 0.18) : .smooth
|
let animation: Animation? = (expectedState == eventIsPlaying) ? .smooth(duration: 0.18) : .smooth
|
||||||
applyPlayState(eventIsPlaying, animation: animation)
|
applyPlayState(eventIsPlaying, animation: animation)
|
||||||
} else {
|
|
||||||
self.updateIdleState(state: eventIsPlaying)
|
|
||||||
}
|
|
||||||
|
|
||||||
if eventIsPlaying && !state.title.isEmpty && !state.artist.isEmpty {
|
if eventIsPlaying && !state.title.isEmpty && !state.artist.isEmpty {
|
||||||
self.updateSneakPeek()
|
self.updateSneakPeek()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
self.updateIdleState(state: eventIsPlaying)
|
||||||
|
}
|
||||||
|
|
||||||
// Check for changes in track metadata using last artwork change values
|
// Check for changes in track metadata using last artwork change values
|
||||||
let titleChanged = state.title != self.lastArtworkTitle
|
let titleChanged = state.title != self.lastArtworkTitle
|
||||||
|
|
@ -239,6 +239,8 @@ class MusicManager: ObservableObject {
|
||||||
let hasContentChange = titleChanged || artistChanged || albumChanged || artworkChanged || bundleChanged
|
let hasContentChange = titleChanged || artistChanged || albumChanged || artworkChanged || bundleChanged
|
||||||
|
|
||||||
// Handle artwork and visual transitions for changed content
|
// Handle artwork and visual transitions for changed content
|
||||||
|
let shouldAutoPeekOnTrackChange = Defaults[.showSneakPeekOnTrackChange]
|
||||||
|
|
||||||
if hasContentChange {
|
if hasContentChange {
|
||||||
self.triggerFlipAnimation()
|
self.triggerFlipAnimation()
|
||||||
|
|
||||||
|
|
@ -263,7 +265,7 @@ class MusicManager: ObservableObject {
|
||||||
self.fetchLyrics()
|
self.fetchLyrics()
|
||||||
|
|
||||||
// Only update sneak peek if there's actual content and something changed
|
// Only update sneak peek if there's actual content and something changed
|
||||||
if !state.title.isEmpty && !state.artist.isEmpty && state.isPlaying {
|
if shouldAutoPeekOnTrackChange && !state.title.isEmpty && !state.artist.isEmpty && state.isPlaying {
|
||||||
self.updateSneakPeek()
|
self.updateSneakPeek()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -440,6 +440,7 @@ extension Defaults.Keys {
|
||||||
static let coloredSpectrogram = Key<Bool>("coloredSpectrogram", default: true)
|
static let coloredSpectrogram = Key<Bool>("coloredSpectrogram", default: true)
|
||||||
static let enableSneakPeek = Key<Bool>("enableSneakPeek", default: false)
|
static let enableSneakPeek = Key<Bool>("enableSneakPeek", default: false)
|
||||||
static let sneakPeekStyles = Key<SneakPeekStyle>("sneakPeekStyles", default: .standard)
|
static let sneakPeekStyles = Key<SneakPeekStyle>("sneakPeekStyles", default: .standard)
|
||||||
|
static let showSneakPeekOnTrackChange = Key<Bool>("showSneakPeekOnTrackChange", default: true)
|
||||||
static let enableFullscreenMediaDetection = Key<Bool>("enableFullscreenMediaDetection", default: true)
|
static let enableFullscreenMediaDetection = Key<Bool>("enableFullscreenMediaDetection", default: true)
|
||||||
static let waitInterval = Key<Double>("waitInterval", default: 3)
|
static let waitInterval = Key<Double>("waitInterval", default: 3)
|
||||||
static let showShuffleAndRepeat = Key<Bool>("showShuffleAndRepeat", default: true)
|
static let showShuffleAndRepeat = Key<Bool>("showShuffleAndRepeat", default: true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue