Commit d2bd66a373

d2bd66a37316197d89c6264628627eef9e71a04e

parent: 7bc631fb21

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-22 20:50 UTC

Today widget: text styles and scaled widths instead of fixed sizes

Keyword and priority badges use caption2; the gutter, the priority ring and
the category dot scale with the text size.

Ref #221

Layout: unified · split

Sources/OrgstarWidgets/TodayWidget.swift +8 −5
@@ -120,6 +120,9 @@ struct SmallRow: View {
120struct WideRow: View { 120struct WideRow: View {
121 let row: AgendaSnapshot.Row 121 let row: AgendaSnapshot.Row
122 @Environment(\.colorScheme) private var scheme 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 var body: some View { 127 var body: some View {
125 HStack(spacing: 6) { 128 HStack(spacing: 6) {
@@ -127,11 +130,11 @@ struct WideRow: View {
127 .font(.caption2.weight(.medium).monospacedDigit()) 130 .font(.caption2.weight(.medium).monospacedDigit())
128 .foregroundStyle(row.statusColor?.color(scheme) ?? .secondary) 131 .foregroundStyle(row.statusColor?.color(scheme) ?? .secondary)
129 .lineLimit(1) 132 .lineLimit(1)
130 .frame(width: 72, alignment: .leading) 133 .frame(width: gutterWidth, alignment: .leading)
131 if let todo = row.todo { 134 if let todo = row.todo {
132 let color = row.todoColor?.color(scheme) ?? .secondary 135 let color = row.todoColor?.color(scheme) ?? .secondary
133 Text(todo) 136 Text(todo)
134 .font(.system(size: 9, weight: .bold)) 137 .font(.caption2.weight(.bold))
135 .foregroundStyle(color) 138 .foregroundStyle(color)
136 .padding(.horizontal, 4) 139 .padding(.horizontal, 4)
137 .padding(.vertical, 1) 140 .padding(.vertical, 1)
@@ -140,14 +143,14 @@ struct WideRow: View {
140 if let priority = row.priority { 143 if let priority = row.priority {
141 let color = row.priorityColor?.color(scheme) ?? .orange 144 let color = row.priorityColor?.color(scheme) ?? .orange
142 Text(priority) 145 Text(priority)
143 .font(.system(size: 9, weight: .bold)) 146 .font(.caption2.weight(.bold))
144 .foregroundStyle(color) 147 .foregroundStyle(color)
145 .frame(width: 14, height: 14) 148 .frame(width: priorityRing, height: priorityRing)
146 .overlay(Circle().strokeBorder(color, lineWidth: 1)) 149 .overlay(Circle().strokeBorder(color, lineWidth: 1))
147 } 150 }
148 Text(row.title).font(.caption).lineLimit(1) 151 Text(row.title).font(.caption).lineLimit(1)
149 Spacer(minLength: 0) 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}