mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fully working Liquid Glass Optimization
This commit is contained in:
parent
1d6cdf866a
commit
c1703abcfc
3 changed files with 21 additions and 77 deletions
|
|
@ -1591,10 +1591,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"±10 Seconds" : {
|
|
||||||
"comment" : "Displayed as the name of the music skip behavior option.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"0" : {
|
"0" : {
|
||||||
"comment" : "A label displayed in a circular gauge to indicate the minimum battery level.",
|
"comment" : "A label displayed in a circular gauge to indicate the minimum battery level.",
|
||||||
"isCommentAutoGenerated" : true,
|
"isCommentAutoGenerated" : true,
|
||||||
|
|
@ -1911,10 +1907,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Accent" : {
|
|
||||||
"comment" : "Display name for the \"Accent\" caps lock indicator tint mode.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Accent color" : {
|
"Accent color" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
@ -2260,10 +2252,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Adaptive gradient" : {
|
|
||||||
"comment" : "Name of the timer icon color mode option that uses an adaptive gradient.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Add" : {
|
"Add" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
@ -3853,10 +3841,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Apple Music" : {
|
|
||||||
"comment" : "Localized name for \"Now Playing\" media controller type.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Applies the notch-style parallax effect to the lock screen media widget album art." : {
|
"Applies the notch-style parallax effect to the lock screen media widget album art." : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"pt-BR" : {
|
"pt-BR" : {
|
||||||
|
|
@ -4268,10 +4252,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Bar" : {
|
|
||||||
"comment" : "Localized name for the \"Bar\" timer progress style.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Battery" : {
|
"Battery" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
@ -8511,10 +8491,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Digital" : {
|
|
||||||
"comment" : "The display name for the \"Digital\" reminder presentation style.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Dimensions" : {
|
"Dimensions" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"pt-BR" : {
|
"pt-BR" : {
|
||||||
|
|
@ -11885,10 +11861,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Green" : {
|
|
||||||
"comment" : "Name of the \"Green\" Caps Lock Indicator Tint Mode.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Height:" : {
|
"Height:" : {
|
||||||
"extractionState" : "stale",
|
"extractionState" : "stale",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|
@ -15555,6 +15527,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Minutes" : {
|
"Minutes" : {
|
||||||
|
"extractionState" : "stale",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"fr" : {
|
"fr" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
|
|
@ -17764,10 +17737,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Now Playing" : {
|
|
||||||
"comment" : "Localized name for each media controller type.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Off" : {
|
"Off" : {
|
||||||
"comment" : "Text displayed in a status label at the top of the screen indicating whether low power mode is on or off.",
|
"comment" : "Text displayed in a status label at the top of the screen indicating whether low power mode is on or off.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
|
|
@ -18134,10 +18103,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Panel" : {
|
|
||||||
"comment" : "Name for the \"Panel\" clipboard display mode.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Panel mode shows clipboard in a floating window near the notch." : {
|
"Panel mode shows clipboard in a floating window near the notch." : {
|
||||||
"comment" : "A description of the \"Panel\" clipboard display mode.",
|
"comment" : "A description of the \"Panel\" clipboard display mode.",
|
||||||
"isCommentAutoGenerated" : true,
|
"isCommentAutoGenerated" : true,
|
||||||
|
|
@ -19732,10 +19697,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Ring" : {
|
|
||||||
"comment" : "Name of the timer progress style that shows a ring animation.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Rotation:" : {
|
"Rotation:" : {
|
||||||
"extractionState" : "stale",
|
"extractionState" : "stale",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|
@ -20556,10 +20517,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Separate Tab" : {
|
|
||||||
"comment" : "Name of the clipboard display mode option that opens the clipboard in a separate tab.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Separate Tab mode integrates Copied Items and Notes into a single view. If both are enabled, Notes appear on the right and Clipboard on the left." : {
|
"Separate Tab mode integrates Copied Items and Notes into a single view. If both are enabled, Notes appear on the right and Clipboard on the left." : {
|
||||||
"comment" : "A description of the \"Separate Tab\" clipboard display mode.",
|
"comment" : "A description of the \"Separate Tab\" clipboard display mode.",
|
||||||
"isCommentAutoGenerated" : true,
|
"isCommentAutoGenerated" : true,
|
||||||
|
|
@ -21614,14 +21571,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Shows screen assistant as a dropdown attached to the AI button" : {
|
|
||||||
"comment" : "Description of the \"Popover\" display mode for the screen assistant.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Shows screen assistant in a floating panel near the notch" : {
|
|
||||||
"comment" : "Description of the \"panel\" display mode for the screen assistant.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Shows the model's reasoning process before the final answer" : {
|
"Shows the model's reasoning process before the final answer" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"fr" : {
|
"fr" : {
|
||||||
|
|
@ -21684,10 +21633,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Skip forward or backward by ten seconds" : {
|
|
||||||
"comment" : "Description of a music skip behavior where the user can skip forward or backward by ten seconds.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Slider color" : {
|
"Slider color" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
@ -22255,10 +22200,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Spotify" : {
|
|
||||||
"comment" : "Add more media player types here.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Square" : {
|
"Square" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
@ -22367,10 +22308,6 @@
|
||||||
},
|
},
|
||||||
"Standard notch media controls are hidden. Re-enable the toggle above to restore them." : {
|
"Standard notch media controls are hidden. Re-enable the toggle above to restore them." : {
|
||||||
|
|
||||||
},
|
|
||||||
"Standard previous/next track controls" : {
|
|
||||||
"comment" : "Description of a music skip behavior option that skips to the previous or next track.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
},
|
||||||
"Start" : {
|
"Start" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|
@ -23720,10 +23657,6 @@
|
||||||
},
|
},
|
||||||
"shouldTranslate" : false
|
"shouldTranslate" : false
|
||||||
},
|
},
|
||||||
"Track Skip" : {
|
|
||||||
"comment" : "Display name for the \"Track Skip\" music skip behavior.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"Transform" : {
|
"Transform" : {
|
||||||
"extractionState" : "stale",
|
"extractionState" : "stale",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|
@ -25634,10 +25567,6 @@
|
||||||
"comment" : "A footer note explaining the app's funding.",
|
"comment" : "A footer note explaining the app's funding.",
|
||||||
"isCommentAutoGenerated" : true
|
"isCommentAutoGenerated" : true
|
||||||
},
|
},
|
||||||
"Youtube Music" : {
|
|
||||||
"comment" : "Name for the media controller type that links to YouTube Music.",
|
|
||||||
"isCommentAutoGenerated" : true
|
|
||||||
},
|
|
||||||
"YouTube Music requires this third-party app to be installed: " : {
|
"YouTube Music requires this third-party app to be installed: " : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"ar" : {
|
"ar" : {
|
||||||
|
|
|
||||||
|
|
@ -356,12 +356,17 @@ struct LockScreenMusicPanel: View {
|
||||||
collapseWorkItem = nil
|
collapseWorkItem = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var isProgressTimelinePaused: Bool {
|
||||||
|
!musicManager.isPlaying || musicManager.isLiveStream || musicManager.playbackRate <= 0
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Progress Bar
|
// MARK: - Progress Bar
|
||||||
|
|
||||||
private var progressBar: some View {
|
private var progressBar: some View {
|
||||||
TimelineView(
|
TimelineView(
|
||||||
.animation(
|
.animation(
|
||||||
minimumInterval: (!musicManager.isLiveStream && musicManager.playbackRate > 0) ? 0.1 : nil
|
minimumInterval: 0.1,
|
||||||
|
paused: isProgressTimelinePaused
|
||||||
)
|
)
|
||||||
) { timeline in
|
) { timeline in
|
||||||
MusicSliderView(
|
MusicSliderView(
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ private final class LiquidGlassContainerView: NSView {
|
||||||
|
|
||||||
private var observedBackdropLayers: [CALayer] = []
|
private var observedBackdropLayers: [CALayer] = []
|
||||||
private var hasScheduledBackdropSetup = false
|
private var hasScheduledBackdropSetup = false
|
||||||
|
private let windowServerAwareKeyPath = "windowServerAware"
|
||||||
|
private let scaleKeyPath = "scale"
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
removeBackdropObservers()
|
removeBackdropObservers()
|
||||||
|
|
@ -69,13 +71,15 @@ private final class LiquidGlassContainerView: NSView {
|
||||||
removeBackdropObservers()
|
removeBackdropObservers()
|
||||||
observedBackdropLayers = newBackdropLayers
|
observedBackdropLayers = newBackdropLayers
|
||||||
for backdrop in observedBackdropLayers {
|
for backdrop in observedBackdropLayers {
|
||||||
backdrop.addObserver(self, forKeyPath: "windowServerAware", options: [.old, .new], context: nil)
|
backdrop.addObserver(self, forKeyPath: windowServerAwareKeyPath, options: [.old, .new], context: nil)
|
||||||
|
backdrop.addObserver(self, forKeyPath: scaleKeyPath, options: [.old, .new], context: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setBackdropProperties(in layer: CALayer) {
|
private func setBackdropProperties(in layer: CALayer) {
|
||||||
if NSStringFromClass(type(of: layer)).contains("CABackdropLayer") {
|
if NSStringFromClass(type(of: layer)).contains("CABackdropLayer") {
|
||||||
layer.setValue(true, forKey: "windowServerAware")
|
layer.setValue(true, forKey: windowServerAwareKeyPath)
|
||||||
|
layer.setValue(1.0, forKey: scaleKeyPath)
|
||||||
}
|
}
|
||||||
layer.sublayers?.forEach { setBackdropProperties(in: $0) }
|
layer.sublayers?.forEach { setBackdropProperties(in: $0) }
|
||||||
}
|
}
|
||||||
|
|
@ -95,10 +99,15 @@ private final class LiquidGlassContainerView: NSView {
|
||||||
change: [NSKeyValueChangeKey: Any]?,
|
change: [NSKeyValueChangeKey: Any]?,
|
||||||
context: UnsafeMutableRawPointer?
|
context: UnsafeMutableRawPointer?
|
||||||
) {
|
) {
|
||||||
if keyPath == "windowServerAware" {
|
if keyPath == windowServerAwareKeyPath {
|
||||||
if change?[.newKey] as? Bool == false {
|
if change?[.newKey] as? Bool == false {
|
||||||
configureBackdropLayers()
|
configureBackdropLayers()
|
||||||
}
|
}
|
||||||
|
} else if keyPath == scaleKeyPath {
|
||||||
|
guard let layer = object as? CALayer else { return }
|
||||||
|
if let newScale = (change?[.newKey] as? NSNumber)?.doubleValue, newScale != 1.0 {
|
||||||
|
layer.setValue(1.0, forKey: scaleKeyPath)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
|
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +115,8 @@ private final class LiquidGlassContainerView: NSView {
|
||||||
|
|
||||||
private func removeBackdropObservers() {
|
private func removeBackdropObservers() {
|
||||||
for layer in observedBackdropLayers {
|
for layer in observedBackdropLayers {
|
||||||
layer.removeObserver(self, forKeyPath: "windowServerAware")
|
layer.removeObserver(self, forKeyPath: windowServerAwareKeyPath)
|
||||||
|
layer.removeObserver(self, forKeyPath: scaleKeyPath)
|
||||||
}
|
}
|
||||||
observedBackdropLayers.removeAll()
|
observedBackdropLayers.removeAll()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue