@@ -28,6 +28,7 @@ import 'theme.dart';
2828class MessageListTheme extends ThemeExtension <MessageListTheme > {
2929 MessageListTheme .light () :
3030 this ._(
31+ dmRecipientHeaderBg: const HSLColor .fromAHSL (1 , 46 , 0.35 , 0.93 ).toColor (),
3132 streamMessageBgDefault: Colors .white,
3233
3334 // TODO(design) this seems ad-hoc; is there a better color?
@@ -36,13 +37,15 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
3637
3738 MessageListTheme .dark () :
3839 this ._(
40+ dmRecipientHeaderBg: const HSLColor .fromAHSL (1 , 46 , 0.15 , 0.2 ).toColor (),
3941 streamMessageBgDefault: const HSLColor .fromAHSL (1 , 0 , 0 , 0.15 ).toColor (),
4042
4143 // TODO(design) this is ad-hoc and untested; is there a better color?
4244 unsubscribedStreamRecipientHeaderBg: const Color (0xff0a0a0a ),
4345 );
4446
4547 MessageListTheme ._({
48+ required this .dmRecipientHeaderBg,
4649 required this .streamMessageBgDefault,
4750 required this .unsubscribedStreamRecipientHeaderBg,
4851 });
@@ -57,15 +60,18 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
5760 return extension ! ;
5861 }
5962
63+ final Color dmRecipientHeaderBg;
6064 final Color streamMessageBgDefault;
6165 final Color unsubscribedStreamRecipientHeaderBg;
6266
6367 @override
6468 MessageListTheme copyWith ({
69+ Color ? dmRecipientHeaderBg,
6570 Color ? streamMessageBgDefault,
6671 Color ? unsubscribedStreamRecipientHeaderBg,
6772 }) {
6873 return MessageListTheme ._(
74+ dmRecipientHeaderBg: dmRecipientHeaderBg ?? this .dmRecipientHeaderBg,
6975 streamMessageBgDefault: streamMessageBgDefault ?? this .streamMessageBgDefault,
7076 unsubscribedStreamRecipientHeaderBg: unsubscribedStreamRecipientHeaderBg ?? this .unsubscribedStreamRecipientHeaderBg,
7177 );
@@ -77,6 +83,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
7783 return this ;
7884 }
7985 return MessageListTheme ._(
86+ dmRecipientHeaderBg: Color .lerp (streamMessageBgDefault, other.dmRecipientHeaderBg, t)! ,
8087 streamMessageBgDefault: Color .lerp (streamMessageBgDefault, other.streamMessageBgDefault, t)! ,
8188 unsubscribedStreamRecipientHeaderBg: Color .lerp (unsubscribedStreamRecipientHeaderBg, other.unsubscribedStreamRecipientHeaderBg, t)! ,
8289 );
@@ -153,7 +160,7 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
153160 removeAppBarBottomBorder = true ;
154161
155162 case DmNarrow ():
156- appBarBackgroundColor = _kDmRecipientHeaderColor ;
163+ appBarBackgroundColor = messageListTheme.dmRecipientHeaderBg ;
157164 // All recipient headers will match this color; remove distracting line
158165 // (but are recipient headers even needed?)
159166 removeAppBarBottomBorder = true ;
@@ -901,12 +908,14 @@ class DmRecipientHeader extends StatelessWidget {
901908 title = zulipLocalizations.messageListGroupYouWithYourself;
902909 }
903910
911+ final messageListTheme = MessageListTheme .of (context);
912+
904913 return GestureDetector (
905914 onTap: () => Navigator .push (context,
906915 MessageListPage .buildRoute (context: context,
907916 narrow: DmNarrow .ofMessage (message, selfUserId: store.selfUserId))),
908917 child: ColoredBox (
909- color: _kDmRecipientHeaderColor ,
918+ color: messageListTheme.dmRecipientHeaderBg ,
910919 child: Padding (
911920 padding: const EdgeInsets .symmetric (vertical: 11 ),
912921 child: Row (
@@ -927,10 +936,6 @@ class DmRecipientHeader extends StatelessWidget {
927936 }
928937}
929938
930- // TODO(#95): web uses different color in dark mode
931- // --color-background-private-message-header in web/styles/app_variables.css
932- final _kDmRecipientHeaderColor = const HSLColor .fromAHSL (1 , 46 , 0.35 , 0.93 ).toColor ();
933-
934939TextStyle recipientHeaderTextStyle (BuildContext context) {
935940 return TextStyle (
936941 color: _kRecipientHeaderTextColor,
0 commit comments