mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Update auto hide option
This commit is contained in:
parent
233eb8ef71
commit
1a1953e8e6
5 changed files with 24 additions and 7 deletions
|
|
@ -26248,6 +26248,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"When disabled, the notch music player stays visible with placeholder metadata even when playback is inactive." : {
|
||||||
|
|
||||||
},
|
},
|
||||||
"When enabled, Atoll connects to Lunar's TCP socket and displays DDC brightness, contrast, and volume events using your selected HUD style above." : {
|
"When enabled, Atoll connects to Lunar's TCP socket and displays DDC brightness, contrast, and volume events using your selected HUD style above." : {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@ struct MusicPlayerView: View {
|
||||||
.padding(.all, 5)
|
.padding(.all, 5)
|
||||||
MusicControlsView()
|
MusicControlsView()
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.drawingGroup()
|
|
||||||
.compositingGroup()
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
@ -529,11 +527,12 @@ struct NotchHomeView: View {
|
||||||
@ObservedObject private var extensionNotchExperienceManager = ExtensionNotchExperienceManager.shared
|
@ObservedObject private var extensionNotchExperienceManager = ExtensionNotchExperienceManager.shared
|
||||||
@ObservedObject private var musicManager = MusicManager.shared
|
@ObservedObject private var musicManager = MusicManager.shared
|
||||||
@Default(.showStandardMediaControls) private var showStandardMediaControls
|
@Default(.showStandardMediaControls) private var showStandardMediaControls
|
||||||
|
@Default(.autoHideInactiveNotchMediaPlayer) private var autoHideInactiveNotchMediaPlayer
|
||||||
let albumArtNamespace: Namespace.ID
|
let albumArtNamespace: Namespace.ID
|
||||||
|
|
||||||
/// Whether the music player should actively display (enabled AND has real content).
|
/// Whether the music player should actively display (enabled AND has real content).
|
||||||
private var shouldShowMusicPlayer: Bool {
|
private var shouldShowMusicPlayer: Bool {
|
||||||
showStandardMediaControls && musicManager.hasActiveSession
|
showStandardMediaControls && (!autoHideInactiveNotchMediaPlayer || musicManager.hasActiveSession)
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
|
||||||
|
|
@ -747,6 +747,7 @@ struct SettingsView: View {
|
||||||
SettingsSearchEntry(tab: .media, title: "Skip buttons", keywords: ["skip", "controls", "±10"], highlightID: SettingsTab.media.highlightID(for: "Skip buttons")),
|
SettingsSearchEntry(tab: .media, title: "Skip buttons", keywords: ["skip", "controls", "±10"], highlightID: SettingsTab.media.highlightID(for: "Skip buttons")),
|
||||||
SettingsSearchEntry(tab: .media, title: "Sneak Peek Style", keywords: ["sneak peek", "preview"], highlightID: SettingsTab.media.highlightID(for: "Sneak Peek Style")),
|
SettingsSearchEntry(tab: .media, title: "Sneak Peek Style", keywords: ["sneak peek", "preview"], highlightID: SettingsTab.media.highlightID(for: "Sneak Peek Style")),
|
||||||
SettingsSearchEntry(tab: .media, title: "Enable lyrics", keywords: ["lyrics", "song text"], highlightID: SettingsTab.media.highlightID(for: "Enable lyrics")),
|
SettingsSearchEntry(tab: .media, title: "Enable lyrics", keywords: ["lyrics", "song text"], highlightID: SettingsTab.media.highlightID(for: "Enable lyrics")),
|
||||||
|
SettingsSearchEntry(tab: .media, title: "Auto-hide inactive notch media player", keywords: ["auto hide", "inactive", "placeholder", "notch media"], highlightID: SettingsTab.media.highlightID(for: "Auto-hide inactive notch media player")),
|
||||||
SettingsSearchEntry(tab: .media, title: "Show Change Media Output control", keywords: ["airplay", "route picker", "media output"], highlightID: SettingsTab.media.highlightID(for: "Show Change Media Output control")),
|
SettingsSearchEntry(tab: .media, title: "Show Change Media Output control", keywords: ["airplay", "route picker", "media output"], highlightID: SettingsTab.media.highlightID(for: "Show Change Media Output control")),
|
||||||
SettingsSearchEntry(tab: .media, title: "Enable album art parallax", keywords: ["parallax", "lock screen", "album art"], highlightID: SettingsTab.media.highlightID(for: "Enable album art parallax")),
|
SettingsSearchEntry(tab: .media, title: "Enable album art parallax", keywords: ["parallax", "lock screen", "album art"], highlightID: SettingsTab.media.highlightID(for: "Enable album art parallax")),
|
||||||
SettingsSearchEntry(tab: .media, title: "Enable album art parallax effect", keywords: ["parallax", "parallax effect", "album art"], highlightID: SettingsTab.media.highlightID(for: "Enable album art parallax effect")),
|
SettingsSearchEntry(tab: .media, title: "Enable album art parallax effect", keywords: ["parallax", "parallax effect", "album art"], highlightID: SettingsTab.media.highlightID(for: "Enable album art parallax effect")),
|
||||||
|
|
@ -2397,6 +2398,7 @@ struct Media: View {
|
||||||
@Default(.lockScreenGlassCustomizationMode) private var lockScreenGlassCustomizationMode
|
@Default(.lockScreenGlassCustomizationMode) private var lockScreenGlassCustomizationMode
|
||||||
@Default(.lockScreenMusicAlbumParallaxEnabled) private var lockScreenMusicAlbumParallaxEnabled
|
@Default(.lockScreenMusicAlbumParallaxEnabled) private var lockScreenMusicAlbumParallaxEnabled
|
||||||
@Default(.showStandardMediaControls) private var showStandardMediaControls
|
@Default(.showStandardMediaControls) private var showStandardMediaControls
|
||||||
|
@Default(.autoHideInactiveNotchMediaPlayer) private var autoHideInactiveNotchMediaPlayer
|
||||||
|
|
||||||
private func highlightID(_ title: String) -> String {
|
private func highlightID(_ title: String) -> String {
|
||||||
SettingsTab.media.highlightID(for: title)
|
SettingsTab.media.highlightID(for: title)
|
||||||
|
|
@ -2444,6 +2446,10 @@ struct Media: View {
|
||||||
.disabled(enableMinimalisticUI)
|
.disabled(enableMinimalisticUI)
|
||||||
.settingsHighlight(id: highlightID("Show media controls in Dynamic Island"))
|
.settingsHighlight(id: highlightID("Show media controls in Dynamic Island"))
|
||||||
|
|
||||||
|
Defaults.Toggle("Auto-hide inactive notch media player", key: .autoHideInactiveNotchMediaPlayer)
|
||||||
|
.disabled(enableMinimalisticUI || !showStandardMediaControls)
|
||||||
|
.settingsHighlight(id: highlightID("Auto-hide inactive notch media player"))
|
||||||
|
|
||||||
if enableMinimalisticUI {
|
if enableMinimalisticUI {
|
||||||
Text("Disable Minimalistic UI to configure the standard notch media controls.")
|
Text("Disable Minimalistic UI to configure the standard notch media controls.")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
|
|
@ -2452,6 +2458,10 @@ struct Media: View {
|
||||||
Text("Standard notch media controls are hidden. Re-enable the toggle above to restore them.")
|
Text("Standard notch media controls are hidden. Re-enable the toggle above to restore them.")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
} else if !autoHideInactiveNotchMediaPlayer {
|
||||||
|
Text("When disabled, the notch music player stays visible with placeholder metadata even when playback is inactive.")
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
Text("Dynamic Island Visibility")
|
Text("Dynamic Island Visibility")
|
||||||
|
|
|
||||||
|
|
@ -630,15 +630,19 @@ class MusicManager: ObservableObject {
|
||||||
|
|
||||||
func togglePlay() {
|
func togglePlay() {
|
||||||
guard let controller = activeController else { return }
|
guard let controller = activeController else { return }
|
||||||
|
let targetState = !isPlaying
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
let newState = !isPlaying
|
pendingOptimisticPlayState = targetState
|
||||||
pendingOptimisticPlayState = newState
|
applyPlayState(targetState, animation: .smooth(duration: 0.18))
|
||||||
applyPlayState(newState, animation: .smooth(duration: 0.18))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await controller.togglePlay()
|
if targetState {
|
||||||
|
await controller.play()
|
||||||
|
} else {
|
||||||
|
await controller.pause()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -774,6 +774,7 @@ extension Defaults.Keys {
|
||||||
static let musicSkipBehavior = Key<MusicSkipBehavior>("musicSkipBehavior", default: .track)
|
static let musicSkipBehavior = Key<MusicSkipBehavior>("musicSkipBehavior", default: .track)
|
||||||
static let musicControlWindowEnabled = Key<Bool>("musicControlWindowEnabled", default: false)
|
static let musicControlWindowEnabled = Key<Bool>("musicControlWindowEnabled", default: false)
|
||||||
static let showStandardMediaControls = Key<Bool>("showStandardMediaControls", default: true)
|
static let showStandardMediaControls = Key<Bool>("showStandardMediaControls", default: true)
|
||||||
|
static let autoHideInactiveNotchMediaPlayer = Key<Bool>("autoHideInactiveNotchMediaPlayer", default: true)
|
||||||
static let cachedMusicLiveActivityPreference = Key<Bool?>("cachedMusicLiveActivityPreference", default: nil)
|
static let cachedMusicLiveActivityPreference = Key<Bool?>("cachedMusicLiveActivityPreference", default: nil)
|
||||||
static let cachedLockScreenMediaWidgetPreference = Key<Bool?>("cachedLockScreenMediaWidgetPreference", default: nil)
|
static let cachedLockScreenMediaWidgetPreference = Key<Bool?>("cachedLockScreenMediaWidgetPreference", default: nil)
|
||||||
static let cachedMusicControlWindowPreference = Key<Bool?>("cachedMusicControlWindowPreference", default: nil)
|
static let cachedMusicControlWindowPreference = Key<Bool?>("cachedMusicControlWindowPreference", default: nil)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue