fix(todo): Today's tab centres its day in the calendar
The day stood on the calendar's bottom edge: a line box's place in the space below the calendar's line was the font's to choose. It is placed by its baseline now. Whats-New: Today's tab shows its day centred in the calendar. Whats-New-De: Der Heute-Tab zeigt den Tag mittig im Kalender. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
53313978f1
commit
6ee7aeabc0
1 changed files with 63 additions and 16 deletions
|
|
@ -8,6 +8,12 @@ import 'package:material_ui/material_ui.dart';
|
|||
/// blank calendar with today's day of the month in it, as Lucide's
|
||||
/// `calendar-1` holds a 1, drawn anew at midnight.
|
||||
class const TodayIcon({super.key}) extends StatefulWidget {
|
||||
/// The day's size, in the calendar's 24 units.
|
||||
static const _fontSize = 9.6;
|
||||
|
||||
/// Noto Sans' digits' height, of the font's size.
|
||||
static const _digitHeight = 0.714;
|
||||
|
||||
@override
|
||||
State<TodayIcon> createState() => _TodayIconState();
|
||||
}
|
||||
|
|
@ -49,22 +55,27 @@ class _TodayIconState() extends State<TodayIcon> {
|
|||
alignment: Alignment.center,
|
||||
children: [
|
||||
const Icon(LucideIcons.calendar),
|
||||
// Lucide's calendar: its box from 4 to 22 of 24 units, the line
|
||||
// under its rings at 10; the day centred in what is below it.
|
||||
Positioned(
|
||||
top: size * 10 / 24,
|
||||
bottom: size * 2 / 24,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${clock.now().day}',
|
||||
textScaler: TextScaler.noScaling,
|
||||
style: TextStyle(
|
||||
color: icon.color,
|
||||
fontSize: size * 0.4,
|
||||
height: 1,
|
||||
fontWeight: FontWeight.w700,
|
||||
// Lucide's calendar: inside its strokes from 11 to 21 of 24 units.
|
||||
// Placed by its baseline, a line box's place in it being the font's
|
||||
// to choose (the day stood on the frame, 5 Nov 2026).
|
||||
Positioned.fill(
|
||||
child: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Baseline(
|
||||
baseline:
|
||||
size *
|
||||
(16 + TodayIcon._digitHeight * TodayIcon._fontSize / 2) /
|
||||
24,
|
||||
baselineType: TextBaseline.alphabetic,
|
||||
child: Text(
|
||||
'${clock.now().day}',
|
||||
textScaler: TextScaler.noScaling,
|
||||
style: TextStyle(
|
||||
color: icon.color,
|
||||
fontSize: size * TodayIcon._fontSize / 24,
|
||||
height: 1,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue