Files
calendula/app
Jean-Luc Makiolaandmakiolaj b0d86af959 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
2026-09-07 20:02:33 +02:00
..
2026-09-02 12:44:40 +02:00
2026-09-02 12:44:40 +02:00