mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Chnaged the music thumbnails to be exactly like the default MacOS media player thumbnails
This commit is contained in:
parent
90b5dae3ba
commit
034ec9e445
7 changed files with 63 additions and 54 deletions
|
|
@ -1142,18 +1142,21 @@ struct MinimalisticAlbumArtView: View {
|
|||
Button {
|
||||
musicManager.openMusicApp()
|
||||
} label: {
|
||||
Color.clear
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.background(
|
||||
Image(nsImage: musicManager.albumArt)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
)
|
||||
.clipped()
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
.matchedGeometryEffect(id: "albumArt", in: albumArtNamespace)
|
||||
.albumArtFlip(angle: musicManager.flipAngle)
|
||||
.parallax3D()
|
||||
Color.clear
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.background(
|
||||
|
||||
Image(nsImage: musicManager.albumArt)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.clipShape(RoundedRectangle(cornerRadius: musicManager.albumArt.size.width/musicManager.albumArt.size.height > 1.0 ? 4 : 12))
|
||||
|
||||
|
||||
)
|
||||
.clipped()
|
||||
.matchedGeometryEffect(id: "albumArt", in: albumArtNamespace)
|
||||
.albumArtFlip(angle: musicManager.flipAngle)
|
||||
.parallax3D()
|
||||
}
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
.opacity(musicManager.isPlaying ? 1 : 0.4)
|
||||
|
|
|
|||
|
|
@ -60,15 +60,18 @@ struct AlbumArtView: View {
|
|||
.background(
|
||||
Image(nsImage: musicManager.albumArt)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.clipShape(
|
||||
RoundedRectangle(
|
||||
cornerRadius: Defaults[.cornerRadiusScaling]
|
||||
? musicManager.albumArt.size.width/musicManager.albumArt.size.height > 1.0 ? MusicPlayerImageSizes.cornerRadiusInset.opened/3 : MusicPlayerImageSizes.cornerRadiusInset.opened
|
||||
: musicManager.albumArt.size.width/musicManager.albumArt.size.height > 1.0 ? MusicPlayerImageSizes.cornerRadiusInset.closed/3 : MusicPlayerImageSizes.cornerRadiusInset.closed
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
.clipped()
|
||||
.clipShape(
|
||||
RoundedRectangle(
|
||||
cornerRadius: Defaults[.cornerRadiusScaling]
|
||||
? MusicPlayerImageSizes.cornerRadiusInset.opened
|
||||
: MusicPlayerImageSizes.cornerRadiusInset.closed)
|
||||
)
|
||||
.scaleEffect(x: 1.3, y: 1.4)
|
||||
.rotationEffect(.degrees(92))
|
||||
.blur(radius: 40)
|
||||
|
|
@ -110,17 +113,19 @@ struct AlbumArtView: View {
|
|||
.overlay {
|
||||
Image(nsImage: musicManager.albumArt)
|
||||
.resizable()
|
||||
.scaledToFill() //to ensure the thumbnail will always be within the square icon
|
||||
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.clipShape(
|
||||
RoundedRectangle(
|
||||
cornerRadius: Defaults[.cornerRadiusScaling]
|
||||
? musicManager.albumArt.size.width/musicManager.albumArt.size.height > 1.0 ? MusicPlayerImageSizes.cornerRadiusInset.opened/3 : MusicPlayerImageSizes.cornerRadiusInset.opened
|
||||
: musicManager.albumArt.size.width/musicManager.albumArt.size.height > 1.0 ? MusicPlayerImageSizes.cornerRadiusInset.closed/3 : MusicPlayerImageSizes.cornerRadiusInset.closed
|
||||
|
||||
|
||||
)
|
||||
) // ensures that even the rectagular album cover is rounded just like the MacOS media player
|
||||
}
|
||||
.matchedGeometryEffect(id: "albumArt", in: albumArtNamespace)
|
||||
.clipped()
|
||||
.clipShape(
|
||||
RoundedRectangle(
|
||||
cornerRadius: Defaults[.cornerRadiusScaling]
|
||||
? MusicPlayerImageSizes.cornerRadiusInset.opened
|
||||
: MusicPlayerImageSizes.cornerRadiusInset.closed)
|
||||
)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue