Add a timeline scale setting for week and day view (#56)

One shared "Hour height" setting under Settings > Views > Week & day:
fit whole day, compact, regular (the old 56dp) or comfortable. Fit whole
day derives the hour height from the timeline's own viewport, so the
whole day fits without scrolling.

The hour height was a private constant in both screens; it now comes
from a preference via LocalTimelineScale. The minimum event height
follows it as a fraction of an hour instead of a fixed 24dp, so short
events keep the same relationship to their neighbours at every scale.

While in there, blocks now only draw text they can draw whole: a block
too short for a full line drops its title instead of showing a sliced
one, one that cannot fit title and time keeps the title, and a block too
narrow to hold more than a syllable stays on one ellipsised line rather
than stacking letters vertically.
This commit is contained in:
2026-07-31 15:52:05 +02:00
parent 0097a9c534
commit 37995d1fb3
11 changed files with 377 additions and 81 deletions

View File

@@ -363,6 +363,16 @@
<string name="settings_time_format_auto_summary">Following the system: %1$s</string>
<string name="settings_hour_lines">Hour lines</string>
<string name="settings_hour_lines_summary">Show a separator line at each hour in week and day view</string>
<string name="settings_timeline_scale">Hour height</string>
<string name="settings_timeline_scale_hint">How much vertical space one hour takes in week and day view. Both views share this setting.</string>
<string name="timeline_scale_fit_day">Fit whole day</string>
<string name="timeline_scale_fit_day_summary">All 24 hours on one screen, no scrolling</string>
<string name="timeline_scale_compact">Compact</string>
<string name="timeline_scale_compact_summary">More hours per screen, smaller blocks</string>
<string name="timeline_scale_regular">Regular</string>
<string name="timeline_scale_regular_summary">The standard spacing</string>
<string name="timeline_scale_comfortable">Comfortable</string>
<string name="timeline_scale_comfortable_summary">Roomier blocks, more scrolling</string>
<string name="settings_dim_completed">Dim completed events</string>
<string name="settings_dim_completed_summary">Fade events that have already ended in month and week view</string>
<string name="settings_past_events">Past events</string>