Slightly more compact thumbnails badges

This commit is contained in:
Arkadiusz Fal 2022-01-07 20:06:18 +01:00
parent 5b12dbcb1e
commit d096fdb344

View File

@ -1,3 +1,4 @@
import Defaults
import SwiftUI import SwiftUI
struct DetailBadge: View { struct DetailBadge: View {
@ -82,12 +83,17 @@ struct DetailBadge: View {
var text: String var text: String
var style: Style = .default var style: Style = .default
@Default(.roundedThumbnails) private var roundedThumbnails
var body: some View { var body: some View {
Text(text) Text(text)
.truncationMode(.middle) .truncationMode(.middle)
.padding(10) .padding(4)
#if os(tvOS)
.padding(.horizontal, 5)
#endif
.modifier(StyleModifier(style: style)) .modifier(StyleModifier(style: style))
.mask(RoundedRectangle(cornerRadius: 12)) .mask(RoundedRectangle(cornerRadius: roundedThumbnails ? 6 : 0))
} }
} }