Skip to content

Commit 45e4ef4

Browse files
committed
msglist: Adjust text styles in MessageWithPossibleSender
1 parent 1b0061e commit 45e4ef4

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

lib/widgets/message_list.dart

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ String formatHeaderDate(
841841
}
842842

843843
/// A Zulip message, showing the sender's name and avatar if specified.
844+
// Design referenced from:
845+
// - https://github.com/zulip/zulip-mobile/issues/5511
846+
// - https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=538%3A20849&mode=dev
844847
class MessageWithPossibleSender extends StatelessWidget {
845848
const MessageWithPossibleSender({super.key, required this.item});
846849

@@ -855,7 +858,6 @@ class MessageWithPossibleSender extends StatelessWidget {
855858
return GestureDetector(
856859
behavior: HitTestBehavior.translucent,
857860
onLongPress: () => showMessageActionSheet(context: context, message: message),
858-
// TODO clean up this layout, by less precisely imitating web
859861
child: Padding(
860862
padding: const EdgeInsets.only(top: 2, bottom: 3, left: 8, right: 8),
861863
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
@@ -880,7 +882,12 @@ class MessageWithPossibleSender extends StatelessWidget {
880882
ProfilePage.buildRoute(context: context,
881883
userId: message.senderId)),
882884
child: Text(message.senderFullName, // TODO get from user data
883-
style: const TextStyle(fontWeight: FontWeight.bold))),
885+
style: const TextStyle(
886+
fontFamily: 'Source Sans 3',
887+
fontSize: 18,
888+
height: (22 / 18),
889+
).merge(weightVariableTextStyle(context, wght: 600,
890+
wghtIfPlatformRequestsBold: 900)))),
884891
const SizedBox(height: 4),
885892
],
886893
MessageContent(message: message, content: item.content),
@@ -891,19 +898,22 @@ class MessageWithPossibleSender extends StatelessWidget {
891898
width: 80,
892899
padding: const EdgeInsets.only(top: 4, right: 16 - 8),
893900
alignment: Alignment.topRight,
894-
child: Text(time, style: _kMessageTimestampStyle)),
901+
child: Text(time,
902+
style: TextStyle(
903+
color: _kMessageTimestampColor,
904+
fontFamily: 'Source Sans 3',
905+
fontSize: 16,
906+
height: (18 / 16),
907+
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],
908+
).merge(weightVariableTextStyle(context)))),
895909
])));
896910
}
897911
}
898912

899913
// TODO web seems to ignore locale in formatting time, but we could do better
900914
final _kMessageTimestampFormat = DateFormat('h:mm aa', 'en_US');
901915

902-
// TODO this seems to come out lighter than on web
903-
final _kMessageTimestampStyle = TextStyle(
904-
fontSize: 12,
905-
fontWeight: FontWeight.w400,
906-
color: const HSLColor.fromAHSL(0.4, 0, 0, 0.2).toColor());
916+
final _kMessageTimestampColor = const HSLColor.fromAHSL(1, 0, 0, 0.5).toColor();
907917

908918
Future<void> markNarrowAsRead(BuildContext context, Narrow narrow) async {
909919
final store = PerAccountStoreWidget.of(context);

0 commit comments

Comments
 (0)