mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
BugFix: Janky Animation in the calendar view
This commit is contained in:
parent
4f82ce417e
commit
c34cdfc864
6 changed files with 31 additions and 30 deletions
|
|
@ -166,7 +166,7 @@ struct MinimalisticMusicPlayerView: View {
|
|||
// Add lyrics height if enabled in settings (reserve space even while loading)
|
||||
if enableLyrics {
|
||||
let lyricsTopPadding: CGFloat = 10
|
||||
let lyricsEstimatedHeight: CGFloat = 30
|
||||
let lyricsEstimatedHeight: CGFloat = 34
|
||||
height += lyricsTopPadding + lyricsEstimatedHeight
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,16 +162,27 @@ struct MusicControlsView: View {
|
|||
removal: .move(edge: .top).combined(with: .opacity)
|
||||
)
|
||||
|
||||
Text(musicManager.currentLyrics)
|
||||
.font(.headline)
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
.lineLimit(2)
|
||||
.multilineTextAlignment(.leading)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
let line = musicManager.currentLyrics.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
|
||||
if !line.isEmpty {
|
||||
let lyricsBinding = Binding<String>(
|
||||
get: { musicManager.currentLyrics },
|
||||
set: { _ in }
|
||||
)
|
||||
|
||||
MarqueeText(
|
||||
lyricsBinding,
|
||||
font: .headline,
|
||||
nsFont: .headline,
|
||||
textColor: .white.opacity(0.8),
|
||||
minDuration: 0.35,
|
||||
frameWidth: width
|
||||
)
|
||||
.padding(.top, 2)
|
||||
.id(musicManager.currentLyrics)
|
||||
.id(line)
|
||||
.transition(transition)
|
||||
.animation(.easeInOut(duration: 0.32), value: musicManager.currentLyrics)
|
||||
.animation(.easeInOut(duration: 0.32), value: line)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue