Skip to content

Commit f60d654

Browse files
committed
msglist: Apply updated design to dm recipient headers
Fixes: #373
1 parent 029eb58 commit f60d654

File tree

1 file changed

+22
-35
lines changed

1 file changed

+22
-35
lines changed

lib/widgets/message_list.dart

+22-35
Original file line numberDiff line numberDiff line change
@@ -668,18 +668,28 @@ class DmRecipientHeader extends StatelessWidget {
668668
onTap: () => Navigator.push(context,
669669
MessageListPage.buildRoute(context: context,
670670
narrow: DmNarrow.ofMessage(message, selfUserId: store.account.userId))),
671-
child: DecoratedBox(
672-
decoration: BoxDecoration(
673-
color: Colors.white,
674-
border: Border.all(color: _kDmRecipientHeaderColor)),
675-
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
676-
RecipientHeaderChevronContainer(
677-
color: _kDmRecipientHeaderColor,
678-
child: Text(style: const TextStyle(color: Colors.white),
679-
title)),
680-
RecipientHeaderDate(message: message,
681-
color: _kDmRecipientHeaderDateColor),
682-
])));
671+
child: ColoredBox(
672+
color: _kDmRecipientHeaderColor,
673+
child: Padding(
674+
padding: const EdgeInsets.symmetric(vertical: 11),
675+
child: Row(
676+
crossAxisAlignment: CrossAxisAlignment.center,
677+
children: [
678+
const Padding(
679+
padding: EdgeInsets.symmetric(horizontal: 6),
680+
child: Icon(size: 16, ZulipIcons.user)),
681+
Expanded(
682+
child: Text(title,
683+
style: const TextStyle(
684+
fontFamily: 'Source Sans 3',
685+
fontSize: 16,
686+
letterSpacing: 0.02 * 16,
687+
height: (18 / 16),
688+
).merge(weightVariableTextStyle(context, wght: 600, wghtIfPlatformRequestsBold: 900)),
689+
overflow: TextOverflow.ellipsis)),
690+
RecipientHeaderDate(message: message,
691+
color: _kDmRecipientHeaderDateColor),
692+
]))));
683693
}
684694
}
685695

@@ -719,29 +729,6 @@ class RecipientHeaderDate extends StatelessWidget {
719729

720730
final _kRecipientHeaderDateFormat = DateFormat('y-MM-dd', 'en_US'); // TODO(#278)
721731

722-
/// A widget with the distinctive chevron-tailed shape in Zulip recipient headers.
723-
class RecipientHeaderChevronContainer extends StatelessWidget {
724-
const RecipientHeaderChevronContainer(
725-
{super.key, required this.color, required this.child});
726-
727-
final Color color;
728-
final Widget child;
729-
730-
@override
731-
Widget build(BuildContext context) {
732-
const chevronLength = 5.0;
733-
const recipientBorderShape = BeveledRectangleBorder(
734-
borderRadius: BorderRadius.only(
735-
topRight: Radius.elliptical(chevronLength, double.infinity),
736-
bottomRight: Radius.elliptical(chevronLength, double.infinity)));
737-
return Container(
738-
decoration: ShapeDecoration(color: color, shape: recipientBorderShape),
739-
padding: const EdgeInsets.only(right: chevronLength),
740-
child: Padding(
741-
padding: const EdgeInsets.fromLTRB(16, 4, 6, 3), child: child));
742-
}
743-
}
744-
745732
/// A Zulip message, showing the sender's name and avatar if specified.
746733
class MessageWithPossibleSender extends StatelessWidget {
747734
const MessageWithPossibleSender({super.key, required this.item});

0 commit comments

Comments
 (0)