Commit d2bd66a373
Verified · cmc
Layout: unified · split
Sources/OrgstarWidgets/TodayWidget.swift +8 −5
| @@ -120,6 +120,9 @@ struct SmallRow: View { | ||
| 120 | 120 | struct WideRow: View { |
| 121 | 121 | let row: AgendaSnapshot.Row |
| 122 | 122 | @Environment(\.colorScheme) private var scheme |
| 123 | @ScaledMetric(relativeTo: .caption2) private var gutterWidth: CGFloat = 72 | |
| 124 | @ScaledMetric(relativeTo: .caption2) private var priorityRing: CGFloat = 16 | |
| 125 | @ScaledMetric(relativeTo: .caption) private var categoryDot: CGFloat = 6 | |
| 123 | 126 | |
| 124 | 127 | var body: some View { |
| 125 | 128 | HStack(spacing: 6) { |
| @@ -127,11 +130,11 @@ struct WideRow: View { | ||
| 127 | 130 | .font(.caption2.weight(.medium).monospacedDigit()) |
| 128 | 131 | .foregroundStyle(row.statusColor?.color(scheme) ?? .secondary) |
| 129 | 132 | .lineLimit(1) |
| 130 | .frame(width: 72, alignment: .leading) | |
| 133 | .frame(width: gutterWidth, alignment: .leading) | |
| 131 | 134 | if let todo = row.todo { |
| 132 | 135 | let color = row.todoColor?.color(scheme) ?? .secondary |
| 133 | 136 | Text(todo) |
| 134 | .font(.system(size: 9, weight: .bold)) | |
| 137 | .font(.caption2.weight(.bold)) | |
| 135 | 138 | .foregroundStyle(color) |
| 136 | 139 | .padding(.horizontal, 4) |
| 137 | 140 | .padding(.vertical, 1) |
| @@ -140,14 +143,14 @@ struct WideRow: View { | ||
| 140 | 143 | if let priority = row.priority { |
| 141 | 144 | let color = row.priorityColor?.color(scheme) ?? .orange |
| 142 | 145 | Text(priority) |
| 143 | .font(.system(size: 9, weight: .bold)) | |
| 146 | .font(.caption2.weight(.bold)) | |
| 144 | 147 | .foregroundStyle(color) |
| 145 | .frame(width: 14, height: 14) | |
| 148 | .frame(width: priorityRing, height: priorityRing) | |
| 146 | 149 | .overlay(Circle().strokeBorder(color, lineWidth: 1)) |
| 147 | 150 | } |
| 148 | 151 | Text(row.title).font(.caption).lineLimit(1) |
| 149 | 152 | Spacer(minLength: 0) |
| 150 | Circle().fill(row.categoryColor?.color(scheme) ?? .secondary).frame(width: 6, height: 6) | |
| 153 | Circle().fill(row.categoryColor?.color(scheme) ?? .secondary).frame(width: categoryDot, height: categoryDot) | |
| 151 | 154 | } |
| 152 | 155 | } |
| 153 | 156 | } |