Fill poll view

This commit is contained in:
Thomas Ricouard 2024-01-20 08:55:12 +01:00
parent 21d54cc546
commit 90a2a19bb1

View file

@ -94,7 +94,6 @@ public struct StatusPollView: View {
Text("\(percentForOption(option: option))%") Text("\(percentForOption(option: option))%")
.font(.scaledSubheadline) .font(.scaledSubheadline)
} }
.frame(height: .pollBarHeight)
} }
} }
.accessibilityElement(children: .combine) .accessibilityElement(children: .combine)
@ -186,7 +185,6 @@ public struct StatusPollView: View {
let width = widthForOption(option: option, proxy: proxy) let width = widthForOption(option: option, proxy: proxy)
Rectangle() Rectangle()
.foregroundColor(theme.tintColor) .foregroundColor(theme.tintColor)
.frame(height: .pollBarHeight)
.frame(width: width) .frame(width: width)
if width != proxy.size.width { if width != proxy.size.width {
Spacer() Spacer()
@ -197,7 +195,6 @@ public struct StatusPollView: View {
} }
} }
.foregroundColor(theme.tintColor.opacity(0.40)) .foregroundColor(theme.tintColor.opacity(0.40))
.frame(height: .pollBarHeight)
.clipShape(RoundedRectangle(cornerRadius: 8)) .clipShape(RoundedRectangle(cornerRadius: 8))
HStack { HStack {
@ -205,13 +202,14 @@ public struct StatusPollView: View {
Text(option.title) Text(option.title)
.foregroundColor(theme.labelColor) .foregroundColor(theme.labelColor)
.font(.scaledBody) .font(.scaledBody)
.lineLimit(3)
.minimumScaleFactor(0.7) .minimumScaleFactor(0.7)
} }
.padding(.leading, 12) .padding(.leading, 12)
} }
} }
.frame(height: .pollBarHeight)
} }
.buttonStyle(.borderless) .buttonStyle(.borderless)
.frame(minHeight: .pollBarHeight)
} }
} }