Move price + RAG delta to second row; name line is name-only full width

This commit is contained in:
FuelBoard Contributor
2026-08-11 15:27:57 +01:00
parent 3da5de6da2
commit d8f635fb41
+5 -8
View File
@@ -210,8 +210,7 @@ struct StationRow: View {
.overlay(Circle().stroke(Color.primary.opacity(0.08), lineWidth: 1)) .overlay(Circle().stroke(Color.primary.opacity(0.08), lineWidth: 1))
.shadow(color: .black.opacity(0.08), radius: 2, y: 1) .shadow(color: .black.opacity(0.08), radius: 2, y: 1)
// Name line fills the whole row width (only the logo is to its // Name fills the whole row width; price + details on the row below.
// left); long names wrap instead of being cut off.
VStack(alignment: .leading, spacing: 3) { VStack(alignment: .leading, spacing: 3) {
HStack(alignment: .firstTextBaseline, spacing: 6) { HStack(alignment: .firstTextBaseline, spacing: 6) {
Text(station.name) Text(station.name)
@@ -227,24 +226,22 @@ struct StationRow: View {
.foregroundStyle(.blue) .foregroundStyle(.blue)
} }
Spacer(minLength: 6) Spacer(minLength: 6)
if let price = station.prices[fuel] { }
HStack(spacing: 5) { HStack(spacing: 5) {
if let price = station.prices[fuel] {
Circle() Circle()
.fill(ragColor) .fill(ragColor)
.frame(width: 10, height: 10) .frame(width: 10, height: 10)
Text(String(format: "%.1fp", price)) Text(String(format: "%.1fp", price))
.font(.title3.bold()) .font(.title3.bold())
.monospacedDigit() .monospacedDigit()
}
}
}
HStack(spacing: 5) {
if let deltaText { if let deltaText {
Text(deltaText) Text(deltaText)
.font(.caption2.bold()) .font(.caption2.bold())
.foregroundStyle(ragColor) .foregroundStyle(ragColor)
} }
}
Text("\(station.address), \(station.postcode)") Text("\(station.address), \(station.postcode)")
.font(.caption) .font(.caption)
.foregroundStyle(.secondary) .foregroundStyle(.secondary)