Seat each hour in its own cell (#113) (#280)

The hour lines in week and day view become a per-hour grid, in the same visual
language as the month grid: each hour is a rounded cell on `surfaceContainer`,
separated by a 2dp gap that reveals `surface` behind it, so the boundary is
negative space rather than a stroke drawn across the column. The column's Card
takes `surface` and the container colour moves onto the cells.

### What changed

- `HourLines.kt` → `HourGrid.kt`. `hourGridCells` draws 24 rounded rects in the
  same `drawBehind` the 23 lines used — still a background layer, so blocks keep
  their continuous coordinate space and keep spanning cells.
- The cell corner is the event chip's 4dp rather than the month grid's 12dp: on
  a cell this size the 12dp out-rounds its own content. It is clamped to half
  the shorter side, so neither a fit-the-day sliver nor a narrow week column
  rounds into a lozenge.
- The hour gutter's label lift is derived from the label's own line height
  instead of a hardcoded `-6.dp`, so the label straddles the seam at any font
  scale. This was the third defect the issue listed; the other two (a
  pixel-width stroke, and a "line" broken into seven segments by `COLUMN_GAP`)
  go away with the lines themselves.
- The preference keeps its stored key and its string keys — only the English
  source text and the Kotlin names change (`showHourLines` → `showHourGrid`),
  as the issue asked.

### Deviation

The issue expected block placement to be untouched. It isn't: a block gives up
the same half-gap at each end that the cells do, otherwise an on-the-hour event
overhangs the seam into its neighbours' cells and the grid reads as broken
wherever there is an event. That inset follows through to the drag — the
floating copy takes the same gap off so it stays exactly the size of the block
it lifted off (or it has room for a time label the block had to drop, and the
label appears on long-press and goes again on drop, #267), and the grab is
measured off the block's placement rather than off where the grid seats it. An
end cut at midnight keeps none of the inset and stays against the column edge,
where `timedBlockCuts` already squares it off.

### Note for translators

`settings_hour_lines` and its summary keep their keys but changed meaning, so
the 12 `values-*` files still describe a separator line until Weblate re-syncs.
Renaming the keys is not an option — stale keys in the translations are fatal.

Closes #113

Supersedes #279, which was opened against `main` by mistake and has been undone
there.

Co-authored-by: Jean-Luc Makiola <business@jeanlucmakiola.de>
Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/280
This commit is contained in:
Jean-Luc Makiola
2026-09-07 20:02:33 +02:00
co-authored by makiolaj
parent 60f05a5c65
commit b0d86af959
17 changed files with 394 additions and 99 deletions
+8
View File
@@ -20,6 +20,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
is not in that row. Event times across the month, week and day views are also
set in a regular weight against the title's, so a time reads as a time rather
than as part of the name next to it ([#219]).
- **The hour lines in week and day view are now an hour grid.** The setting
that drew a faint separator line at each hour now seats every hour in its own
rounded cell, so an hour boundary reads as the seam between two surfaces
rather than a line drawn across one — the same negative space that separates
the month grid's days and the week's columns. An event that starts on the hour
fills its cell instead of overhanging the seam, and one that runs past
midnight still meets the edge of its column ([#113]).
- The calendar titles now shorten instead of being cut off. When the full month
name doesn't fit the top bar, the month and week views fall back to its
three-letter form and the day view drops the weekday, rather than trailing off
@@ -1603,3 +1610,4 @@ automatically, with zero telemetry and no internet permission.
[#248]: https://codeberg.org/jlmakiola/calendula/issues/248
[#253]: https://codeberg.org/jlmakiola/calendula/issues/253
[#273]: https://codeberg.org/jlmakiola/calendula/issues/273
[#113]: https://codeberg.org/jlmakiola/calendula/issues/113