Skip to content

Commit c012b7a

Browse files
committed
msglist: Apply text style and padding to stream/topic recipient headers
Fixes: zulip#372
1 parent ae20f19 commit c012b7a

File tree

1 file changed

+35
-22
lines changed

1 file changed

+35
-22
lines changed

lib/widgets/message_list.dart

+35-22
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,13 @@ class StreamMessageRecipientHeader extends StatelessWidget {
554554
(ThemeData.estimateBrightnessForColor(swatch.barBackground) == Brightness.dark)
555555
? Colors.white
556556
: Colors.black;
557-
final textStyle = TextStyle(color: contrastingColor);
557+
final textStyle = TextStyle(
558+
color: contrastingColor,
559+
fontFamily: 'Source Sans 3',
560+
fontSize: 16,
561+
letterSpacing: 0.02 * 16,
562+
height: (18 / 16),
563+
).merge(weightVariableTextStyle(context, wght: 600, wghtIfPlatformRequestsBold: 900));
558564

559565
final streamWidget = (showStream)
560566
? GestureDetector(
@@ -564,12 +570,16 @@ class StreamMessageRecipientHeader extends StatelessWidget {
564570
child: Row(children: [
565571
const SizedBox(width: 16),
566572
// TODO globe/lock icons for web-public and private streams
567-
Text(stream?.name ?? message.displayRecipient, // TODO(log) if missing
568-
style: textStyle),
573+
Padding(
574+
padding: const EdgeInsets.symmetric(vertical: 11),
575+
child: Text(stream?.name ?? message.displayRecipient, // TODO(log) if missing
576+
style: textStyle,
577+
maxLines: 1,
578+
overflow: TextOverflow.ellipsis)),
569579
Padding(
570580
// Figma has 5px horizontal padding around an 8px wide icon.
571581
// Icon is 16px wide here so horizontal padding is 1px.
572-
padding: const EdgeInsets.symmetric(horizontal: 1),
582+
padding: const EdgeInsets.symmetric(horizontal: 1, vertical: 12),
573583
child: Icon(size: 16,
574584
color: contrastingColor.withAlpha(154), // 60%
575585
ZulipIcons.chevron_right)),
@@ -582,24 +592,27 @@ class StreamMessageRecipientHeader extends StatelessWidget {
582592
narrow: TopicNarrow.ofMessage(message))),
583593
child: ColoredBox(
584594
color: swatch.barBackground,
585-
child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [
586-
// TODO(#282): Long stream name will break layout; find a fix.
587-
streamWidget,
588-
Expanded(
589-
child: Padding(
590-
// Web has padding 9, 3, 3, 2 here; but 5px is the chevron.
591-
padding: const EdgeInsets.fromLTRB(4, 3, 3, 2),
592-
child: Text(topic,
593-
// TODO: Give a way to see the whole topic (maybe a
594-
// long-press interaction?)
595-
overflow: TextOverflow.ellipsis,
596-
style: textStyle))),
597-
// TODO topic links?
598-
// Then web also has edit/resolve/mute buttons. Skip those for mobile.
599-
RecipientHeaderDate(message: message,
600-
color: contrastingColor.withAlpha(102)), // 40%
601-
const SizedBox(width: 16),
602-
])));
595+
child: Row(
596+
crossAxisAlignment: CrossAxisAlignment.baseline,
597+
textBaseline: TextBaseline.alphabetic,
598+
children: [
599+
// TODO(#282): Long stream name will break layout; find a fix.
600+
streamWidget,
601+
Expanded(
602+
child: Padding(
603+
padding: const EdgeInsets.symmetric(vertical: 11),
604+
child: Text(topic,
605+
// TODO: Give a way to see the whole topic (maybe a
606+
// long-press interaction?)
607+
style: textStyle,
608+
maxLines: 1,
609+
overflow: TextOverflow.ellipsis))),
610+
// TODO topic links?
611+
// Then web also has edit/resolve/mute buttons. Skip those for mobile.
612+
RecipientHeaderDate(message: message,
613+
color: contrastingColor.withAlpha(102)), // 40%
614+
const SizedBox(width: 16),
615+
])));
603616
}
604617
}
605618

0 commit comments

Comments
 (0)