Price display: station sign drops the £ (134.9) — matches roadside signs; pounds & pence uses forecourt superscript style £1.29⁹/L (small superscript third digit, small /L); attributed Text on list/widgets/Live Activity, Unicode superscript in Siri cards
This commit is contained in:
@@ -70,8 +70,7 @@ private struct FuelBoardLiveActivityView: View {
|
||||
|
||||
// RIGHT — price
|
||||
VStack(alignment: .trailing, spacing: 2) {
|
||||
Text(context.state.priceText)
|
||||
.font(.title2.bold().monospacedDigit())
|
||||
FuelStore.priceTextAttributed(context.state.pricePence, size: 22, weight: .bold)
|
||||
Text("Tap for directions")
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.secondary)
|
||||
@@ -87,8 +86,7 @@ private struct FuelBoardLiveActivityPriceView: View {
|
||||
let context: ActivityViewContext<FuelBoardLiveActivityAttributes>
|
||||
|
||||
var body: some View {
|
||||
Text(context.state.priceText)
|
||||
.font(.headline.bold().monospacedDigit())
|
||||
FuelStore.priceTextAttributed(context.state.pricePence, size: 17, weight: .bold)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +126,7 @@ extension FuelBoardLiveActivityAttributes.ContentState {
|
||||
}
|
||||
|
||||
/// Price string from pence, in the user's chosen display style
|
||||
/// (station sign "£129.9" or pounds "£1.299").
|
||||
/// (station sign "129.9" or pounds "£1.29⁹/L").
|
||||
var priceText: String {
|
||||
FuelStore.priceText(pricePence)
|
||||
}
|
||||
|
||||
@@ -395,9 +395,7 @@ struct FuelPriceWidgetView: View {
|
||||
.font(.headline)
|
||||
.lineLimit(1)
|
||||
if let price = station.prices[entry.fuel] {
|
||||
Text(FuelStore.priceText(price))
|
||||
.font(.system(size: 26, weight: .bold).monospaced())
|
||||
.foregroundStyle(.green)
|
||||
FuelStore.priceTextAttributed(price, size: 26, weight: .bold, color: .green)
|
||||
}
|
||||
if let location = entry.location {
|
||||
Text(entry.unit.format(station.distanceKM(to: location.lat, lng2: location.lng)) + " away")
|
||||
@@ -455,9 +453,7 @@ struct FuelPriceWidgetView: View {
|
||||
Circle()
|
||||
.fill(ragColor(for: price, cheapest: cheapest))
|
||||
.frame(width: 6, height: 6)
|
||||
Text(FuelStore.priceText(price))
|
||||
.font(.caption.weight(.bold).monospaced())
|
||||
.foregroundStyle(.primary)
|
||||
FuelStore.priceTextAttributed(price, size: 12, weight: .bold)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user