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 {
7272 let done = snapshot.habits.filter { $0.habit.doneDates.contains(today) }.count
7373 return VStack(alignment: .leading, spacing: family == .systemSmall ? 6 : 8) {
7474 HStack(alignment: .firstTextBaseline) {
75 Text("Habits").font(.subheadline.weight(.semibold))
75 Text("Habits").font(.subheadline.weight(.semibold)).widgetAccentable()
7676 Spacer(minLength: 0)
7777 Text("\(done)/\(snapshot.habits.count) today").font(.caption2.weight(.semibold)).foregroundStyle(.secondary)
7878 }
@@ -104,9 +104,9 @@ struct HabitsView: View {
104104}
105105
106106/// 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.
110110struct HabitCells: View {
111111 let cells: [Habit.Cell]
112112 let colors: [String: AgendaSnapshot.Hex]
@@ -114,8 +114,9 @@ struct HabitCells: View {
114114 let height: CGFloat
115115 @Environment(\.colorScheme) private var scheme
116116 @Environment(\.accessibilityDifferentiateWithoutColor) private var differentiateWithoutColor
117 @Environment(\.widgetRenderingMode) private var renderingMode
117118
118 private var stepped: Bool { differentiateWithoutColor }
119 private var stepped: Bool { differentiateWithoutColor || renderingMode != .fullColor }
119120
120121 var body: some View {
121122 HStack(spacing: 1) {
Sources/OrgstarWidgets/TodayWidget.swift +1
@@ -72,6 +72,7 @@ struct TodayView: View {
7272 Text(entry.date, format: family == .systemSmall ? .dateTime.weekday(.abbreviated).day() : .dateTime.weekday(.wide).day().month())
7373 .font(.subheadline.weight(.semibold))
7474 .foregroundStyle(snapshot.color("agenda-today", scheme) ?? .accentColor)
75 .widgetAccentable()
7576 Spacer(minLength: 0)
7677 if overdue > 0, family != .systemSmall {
7778 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
225225
226226Widgets 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.
227227
228In 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.
228In 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.
229229
230230** Controls
231231