BugFix: Janky Animation in the calendar view

This commit is contained in:
Hariharan Mudaliar 2025-11-18 00:46:20 +05:30
commit c34cdfc864
6 changed files with 31 additions and 30 deletions

View file

@ -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
}

View file

@ -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)
}
}
}
}