Skip to content

Commit 7100ac5

Browse files
committed
msglist: Follow web and Figma in recipient-header text color
In web this is known as --color-text-message-header, and here is a Figma node: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=538-20849&t=O4Yz8kKlRrXFY8Te-0 This is actually the same color that web uses -- and we use -- for message content. For that usage, web calls it --color-text-message-default. In fact, thanks to the DefaultTextStyle that wraps the whole message list (for the sake of coloring message content), DM recipient header text already had this color. So one option would have been to just remove the black color on stream recipient header text, to allow it to be colored via the same inheritance. But I didn't want to do that. Web has a reason for using separate variables: in dark theme, recipient header text is colored slightly different from message content. So, we'll keep these color definitions separate too, to make it easy to follow web in dark theme.
1 parent 6abafdd commit 7100ac5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/widgets/message_list.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
666666
iconColor = Colors.black;
667667
}
668668
final textStyle = TextStyle(
669-
color: Colors.black,
669+
color: _kRecipientHeaderTextColor,
670670
fontSize: 16,
671671
letterSpacing: proportionalLetterSpacing(context, 0.02, baseFontSize: 16),
672672
height: (18 / 16),
@@ -777,6 +777,7 @@ class DmRecipientHeader extends StatelessWidget {
777777
Expanded(
778778
child: Text(title,
779779
style: TextStyle(
780+
color: _kRecipientHeaderTextColor,
780781
fontSize: 16,
781782
letterSpacing: proportionalLetterSpacing(context, 0.02, baseFontSize: 16),
782783
height: (18 / 16),
@@ -794,6 +795,8 @@ class DmRecipientHeader extends StatelessWidget {
794795
final _kDmRecipientHeaderColor = const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor();
795796
final _kDmRecipientHeaderDateColor = Colors.black.withOpacity(0.4);
796797

798+
final _kRecipientHeaderTextColor = const HSLColor.fromAHSL(1, 0, 0, 0.15).toColor();
799+
797800
class RecipientHeaderDate extends StatelessWidget {
798801
const RecipientHeaderDate({super.key, required this.message, required this.color});
799802

0 commit comments

Comments
 (0)