mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 07:34:32 +00:00
Update stuff
This commit is contained in:
parent
a4e58b9e70
commit
5b41f2c364
3 changed files with 39 additions and 10 deletions
|
|
@ -834,7 +834,9 @@ struct ContentView: View {
|
|||
)
|
||||
let effectiveCenterWidth = inlineSneakPeekActive ? 380 : centerBaseWidth
|
||||
let notchWidth = wingBaseWidth + effectiveCenterWidth + rightWingWidth
|
||||
let badgeSize = max(16, notchContentHeight * 0.45)
|
||||
let badgeBaseSize = max(13, notchContentHeight * 0.36)
|
||||
let badgeDisplaySize = badgeDisplaySize(for: secondary, baseSize: badgeBaseSize)
|
||||
let badgeOffset = badgeOverlayOffset(for: secondary, badgeSize: badgeDisplaySize)
|
||||
|
||||
HStack(spacing: 0) {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
|
|
@ -849,8 +851,8 @@ struct ContentView: View {
|
|||
.clipShape(RoundedRectangle(cornerRadius: MusicPlayerImageSizes.cornerRadiusInset.closed))
|
||||
.matchedGeometryEffect(id: "albumArt", in: albumArtNamespace)
|
||||
.albumArtFlip(angle: musicManager.flipAngle)
|
||||
albumArtBadge(for: secondary, badgeSize: badgeSize)
|
||||
.offset(x: badgeSize * 0.2, y: badgeSize * 0.25)
|
||||
albumArtBadge(for: secondary, badgeSize: badgeDisplaySize)
|
||||
.offset(x: badgeOffset.width, y: badgeOffset.height)
|
||||
.id(secondary?.id ?? "music-badge")
|
||||
.contentTransition(.symbolEffect(.replace))
|
||||
}
|
||||
|
|
@ -1066,6 +1068,26 @@ struct ContentView: View {
|
|||
}
|
||||
}
|
||||
|
||||
private func badgeDisplaySize(for secondary: MusicSecondaryLiveActivity?, baseSize: CGFloat) -> CGFloat {
|
||||
guard let secondary else { return baseSize }
|
||||
switch secondary {
|
||||
case .extensionPayload:
|
||||
return max(11, baseSize * 0.86)
|
||||
default:
|
||||
return baseSize
|
||||
}
|
||||
}
|
||||
|
||||
private func badgeOverlayOffset(for secondary: MusicSecondaryLiveActivity?, badgeSize: CGFloat) -> CGSize {
|
||||
guard let secondary else { return CGSize(width: badgeSize * 0.2, height: badgeSize * 0.25) }
|
||||
switch secondary {
|
||||
case .extensionPayload:
|
||||
return CGSize(width: badgeSize * 0.14, height: badgeSize * 0.12)
|
||||
default:
|
||||
return CGSize(width: badgeSize * 0.2, height: badgeSize * 0.25)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func musicRightWing(for secondary: MusicSecondaryLiveActivity?, notchHeight: CGFloat, trailingWidth: CGFloat) -> some View {
|
||||
switch secondary {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue