Skip to content

Commit 8231c20

Browse files
committed
wip fix vertical alignment
1 parent 3e058ab commit 8231c20

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/widgets/message_list.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ class DateSeparator extends StatelessWidget {
481481
Widget build(BuildContext context) {
482482
final zulipLocalizations = ZulipLocalizations.of(context);
483483

484+
// This makes the small-caps text vertically centered,
485+
// to align with the vertically centered divider lines.
486+
const textBottomPadding = 2.0;
487+
484488
return ColoredBox(color: Colors.white,
485489
child: Padding(
486490
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 2),
@@ -493,17 +497,14 @@ class DateSeparator extends StatelessWidget {
493497
bottom: BorderSide(
494498
width: 0,
495499
color: Colors.black)))))),
496-
Padding(padding: const EdgeInsets.symmetric(horizontal: 2),
500+
Padding(padding: const EdgeInsets.fromLTRB(2, 0, 2, textBottomPadding),
497501
// TODO dedupe with RecipientHeaderDate
498502
child: Text(
499503
style: TextStyle(
500504
color: _textColor,
501505
fontFamily: 'Source Sans 3',
502506
fontSize: 16,
503-
// In Figma this has a line-height of 19, but using 18
504-
// here to match the stream/topic text widgets helps
505-
// to align all the text to the same baseline.
506-
height: (18 / 16),
507+
height: (16 / 16),
507508
// This is equivalent to css `all-small-caps`, see:
508509
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-caps#all-small-caps
509510
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],

0 commit comments

Comments
 (0)