mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 10:55:03 +00:00
Give tvOS toast cards more room between icon and text
This commit is contained in:
@@ -16,7 +16,7 @@ struct ToastCardView: View {
|
|||||||
@State private var isAnimating = false
|
@State private var isAnimating = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: Self.iconSpacing) {
|
||||||
// Leading icon or progress indicator
|
// Leading icon or progress indicator
|
||||||
leadingIcon
|
leadingIcon
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ struct ToastCardView: View {
|
|||||||
dismissButton
|
dismissButton
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, Self.horizontalPadding)
|
||||||
.padding(.vertical, 12)
|
.padding(.vertical, 12)
|
||||||
.frame(maxWidth: 400, alignment: .leading)
|
.frame(maxWidth: 400, alignment: .leading)
|
||||||
.glassBackground(.regular, in: .capsule, fallback: .regularMaterial)
|
.glassBackground(.regular, in: .capsule, fallback: .regularMaterial)
|
||||||
@@ -74,7 +74,31 @@ struct ToastCardView: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: 22, height: 22)
|
.frame(width: Self.iconSize, height: Self.iconSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
private static var iconSpacing: CGFloat {
|
||||||
|
#if os(tvOS)
|
||||||
|
20
|
||||||
|
#else
|
||||||
|
12
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
private static var horizontalPadding: CGFloat {
|
||||||
|
#if os(tvOS)
|
||||||
|
20
|
||||||
|
#else
|
||||||
|
16
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
private static var iconSize: CGFloat {
|
||||||
|
#if os(tvOS)
|
||||||
|
32
|
||||||
|
#else
|
||||||
|
22
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
|
|||||||
Reference in New Issue
Block a user