Commit 741248a32f
741248a32f000514bf746688834089c6ef456912
parent: 326c18adf5
Verified · cmc
cmc <hello@cleberg.net> · 2026-11-22 20:52 UTC
Widgets: accentable headers, habit states by opacity when tinted
In the tinted and clear styles the Today date and the Habits title take the
tint, and the habit graph uses the opacity steps it uses for Differentiate
Without Colour.
Ref #224
Layout: unified · split
Sources/OrgstarWidgets/HabitsWidget.swift
+6 −5
| @@ -72,7 +72,7 @@ struct HabitsView: View { |
| 72 | 72 | let done = snapshot.habits.filter { $0.habit.doneDates.contains(today) }.count |
| 73 | 73 | return VStack(alignment: .leading, spacing: family == .systemSmall ? 6 : 8) { |
| 74 | 74 | HStack(alignment: .firstTextBaseline) { |
| 75 | | Text("Habits").font(.subheadline.weight(.semibold)) |
| 75 | Text("Habits").font(.subheadline.weight(.semibold)).widgetAccentable() |
| 76 | 76 | Spacer(minLength: 0) |
| 77 | 77 | Text("\(done)/\(snapshot.habits.count) today").font(.caption2.weight(.semibold)).foregroundStyle(.secondary) |
| 78 | 78 | } |
| @@ -104,9 +104,9 @@ struct HabitsView: View { |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /// org-habit's graph: a bar per day in the due-state color, lighter for days to come, a dot |
| 107 | | /// where it was done, today outlined. With Differentiate Without Colour, the state is also |
| 108 | | /// how solid the bar is, from clear (faintest) to overdue (solid), and days to come are |
| 109 | | /// outlined. |
| 107 | /// where it was done, today outlined. With Differentiate Without Colour, and in the tinted and |
| 108 | /// clear styles, which draw every colour in one tint, the state is also how solid the bar is, |
| 109 | /// from clear (faintest) to overdue (solid), and days to come are outlined. |
| 110 | 110 | struct HabitCells: View { |
| 111 | 111 | let cells: [Habit.Cell] |
| 112 | 112 | let colors: [String: AgendaSnapshot.Hex] |
| @@ -114,8 +114,9 @@ struct HabitCells: View { |
| 114 | 114 | let height: CGFloat |
| 115 | 115 | @Environment(\.colorScheme) private var scheme |
| 116 | 116 | @Environment(\.accessibilityDifferentiateWithoutColor) private var differentiateWithoutColor |
| 117 | @Environment(\.widgetRenderingMode) private var renderingMode |
| 117 | 118 | |
| 118 | | private var stepped: Bool { differentiateWithoutColor } |
| 119 | private var stepped: Bool { differentiateWithoutColor || renderingMode != .fullColor } |
| 119 | 120 | |
| 120 | 121 | var body: some View { |
| 121 | 122 | HStack(spacing: 1) { |
Sources/OrgstarWidgets/TodayWidget.swift
+1
| @@ -72,6 +72,7 @@ struct TodayView: View { |
| 72 | 72 | Text(entry.date, format: family == .systemSmall ? .dateTime.weekday(.abbreviated).day() : .dateTime.weekday(.wide).day().month()) |
| 73 | 73 | .font(.subheadline.weight(.semibold)) |
| 74 | 74 | .foregroundStyle(snapshot.color("agenda-today", scheme) ?? .accentColor) |
| 75 | .widgetAccentable() |
| 75 | 76 | Spacer(minLength: 0) |
| 76 | 77 | if overdue > 0, family != .systemSmall { |
| 77 | 78 | Text("\(overdue) overdue") |
docs/manual/guide/14-ios.org
+1 −1
| @@ -225,7 +225,7 @@ Tapping a row in the medium or large Today widget opens that entry; tapping else |
| 225 | 225 | |
| 226 | 226 | Widgets can't read your folders, so the app writes the next seven days of the agenda (today included) for them to read: while it is open, when files, edits or settings change, when you return to the app, and every hour. Between those times the widgets move on by themselves as timed entries end and at midnight, but they show nothing new until you open orgstar. Until the app has written the agenda once, they say =Open orgstar to show your agenda here.= The widgets ignore the agenda's filter and show no days without entries. The Habits widget's graphs move on at midnight by themselves. |
| 227 | 227 | |
| 228 | | In the Habits graph a day's bar has the colour of its state: not yet due, due, due today for the last time, or overdue; days to come are lighter. With Differentiate Without Colour on (Settings ▸ Accessibility ▸ Display & Text Size), the states are also told apart by how solid the bar is, from not yet due (faintest) to overdue (solid), and days to come are outlined. |
| 228 | In the Habits graph a day's bar has the colour of its state: not yet due, due, due today for the last time, or overdue; days to come are lighter. In the tinted and clear Home Screen styles, and with Differentiate Without Colour on (Settings ▸ Accessibility ▸ Display & Text Size), the states are also told apart by how solid the bar is, from not yet due (faintest) to overdue (solid), and days to come are outlined. In the tinted style, the Today widget's date and the Habits title take the tint. |
| 229 | 229 | |
| 230 | 230 | ** Controls |
| 231 | 231 | |