Skip to content

Commit 2d46c9e

Browse files
committed
recent dms [nfc]: Place provisional dark-theme colors, pending design
Like we did for the Inbox screen in c6abaf9.
1 parent 5233e7a commit 2d46c9e

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

lib/widgets/recent_dm_conversations.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'icons.dart';
99
import 'message_list.dart';
1010
import 'page.dart';
1111
import 'store.dart';
12+
import 'theme.dart';
1213
import 'unread_count_badge.dart';
1314

1415
class RecentDmConversationsPage extends StatefulWidget {
@@ -91,6 +92,8 @@ class RecentDmConversationsItem extends StatelessWidget {
9192
final store = PerAccountStoreWidget.of(context);
9293
final selfUser = store.users[store.selfUserId]!;
9394

95+
final designVariables = DesignVariables.of(context);
96+
9497
final String title;
9598
final Widget avatar;
9699
switch (narrow.otherRecipientIds) { // TODO dedupe with DM items in [InboxPage]
@@ -109,16 +112,14 @@ class RecentDmConversationsItem extends StatelessWidget {
109112
// new Intl.ListFormat('ja').format(['Chris', 'Greg', 'Alya'])
110113
// // 'Chris、Greg、Alya'
111114
title = narrow.otherRecipientIds.map((id) => store.users[id]?.fullName ?? '(unknown user)').join(', ');
112-
// TODO(#95) need dark-theme color
113-
avatar = ColoredBox(color: const Color(0x33808080),
115+
avatar = ColoredBox(color: designVariables.groupDmConversationIconBg,
114116
child: Center(
115-
// TODO(#95) need dark-theme color
116-
child: Icon(ZulipIcons.group_dm, color: Colors.black.withOpacity(0.5))));
117+
child: Icon(color: designVariables.groupDmConversationIcon,
118+
ZulipIcons.group_dm)));
117119
}
118120

119121
return Material(
120-
// TODO(#95) need dark-theme color
121-
color: Colors.white,
122+
color: designVariables.background, // TODO(design) check if this is the right variable
122123
child: InkWell(
123124
onTap: () {
124125
Navigator.push(context,
@@ -132,11 +133,11 @@ class RecentDmConversationsItem extends StatelessWidget {
132133
Expanded(child: Padding(
133134
padding: const EdgeInsets.symmetric(vertical: 4),
134135
child: Text(
135-
style: const TextStyle(
136+
style: TextStyle(
136137
fontSize: 17,
137138
height: (20 / 17),
138-
// TODO(#95) need dark-theme color
139-
color: Color(0xFF222222),
139+
// TODO(design) check if this is the right variable
140+
color: designVariables.labelMenuButton,
140141
),
141142
maxLines: 2,
142143
overflow: TextOverflow.ellipsis,

lib/widgets/theme.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
144144
errorBannerBackground: const HSLColor.fromAHSL(1, 4, 0.33, 0.90).toColor(),
145145
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.57, 0.33).toColor(),
146146
errorBannerLabel: const HSLColor.fromAHSL(1, 4, 0.58, 0.33).toColor(),
147+
groupDmConversationIcon: Colors.black.withOpacity(0.5),
148+
groupDmConversationIconBg: const Color(0x33808080),
147149
loginOrDivider: const Color(0xffdedede),
148150
loginOrDividerText: const Color(0xff575757),
149151
sectionCollapseIcon: const Color(0x7f1e2e48),
@@ -169,6 +171,10 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
169171
errorBannerBackground: const HSLColor.fromAHSL(1, 0, 0.61, 0.19).toColor(),
170172
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.73, 0.74).toColor(),
171173
errorBannerLabel: const HSLColor.fromAHSL(1, 2, 0.73, 0.80).toColor(),
174+
// TODO(#95) need proper dark-theme color (this is ad hoc)
175+
groupDmConversationIcon: Colors.white.withOpacity(0.5),
176+
// TODO(#95) need proper dark-theme color (this is ad hoc)
177+
groupDmConversationIconBg: const Color(0x33cccccc),
172178
loginOrDivider: const Color(0xff424242),
173179
loginOrDividerText: const Color(0xffa8a8a8),
174180
// TODO(#95) need proper dark-theme color (this is ad hoc)
@@ -194,6 +200,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
194200
required this.errorBannerBackground,
195201
required this.errorBannerBorder,
196202
required this.errorBannerLabel,
203+
required this.groupDmConversationIcon,
204+
required this.groupDmConversationIconBg,
197205
required this.loginOrDivider,
198206
required this.loginOrDividerText,
199207
required this.sectionCollapseIcon,
@@ -230,6 +238,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
230238
final Color errorBannerBackground;
231239
final Color errorBannerBorder;
232240
final Color errorBannerLabel;
241+
final Color groupDmConversationIcon;
242+
final Color groupDmConversationIconBg;
233243
final Color loginOrDivider; // TODO(#95) need proper dark-theme color (this is ad hoc)
234244
final Color loginOrDividerText; // TODO(#95) need proper dark-theme color (this is ad hoc)
235245
final Color sectionCollapseIcon;
@@ -253,6 +263,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
253263
Color? errorBannerBackground,
254264
Color? errorBannerBorder,
255265
Color? errorBannerLabel,
266+
Color? groupDmConversationIcon,
267+
Color? groupDmConversationIconBg,
256268
Color? loginOrDivider,
257269
Color? loginOrDividerText,
258270
Color? sectionCollapseIcon,
@@ -275,6 +287,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
275287
errorBannerBackground: errorBannerBackground ?? this.errorBannerBackground,
276288
errorBannerBorder: errorBannerBorder ?? this.errorBannerBorder,
277289
errorBannerLabel: errorBannerLabel ?? this.errorBannerLabel,
290+
groupDmConversationIcon: groupDmConversationIcon ?? this.groupDmConversationIcon,
291+
groupDmConversationIconBg: groupDmConversationIconBg ?? this.groupDmConversationIconBg,
278292
loginOrDivider: loginOrDivider ?? this.loginOrDivider,
279293
loginOrDividerText: loginOrDividerText ?? this.loginOrDividerText,
280294
sectionCollapseIcon: sectionCollapseIcon ?? this.sectionCollapseIcon,
@@ -304,6 +318,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
304318
errorBannerBackground: Color.lerp(errorBannerBackground, other.errorBannerBackground, t)!,
305319
errorBannerBorder: Color.lerp(errorBannerBorder, other.errorBannerBorder, t)!,
306320
errorBannerLabel: Color.lerp(errorBannerLabel, other.errorBannerLabel, t)!,
321+
groupDmConversationIcon: Color.lerp(groupDmConversationIcon, other.groupDmConversationIcon, t)!,
322+
groupDmConversationIconBg: Color.lerp(groupDmConversationIconBg, other.groupDmConversationIconBg, t)!,
307323
loginOrDivider: Color.lerp(loginOrDivider, other.loginOrDivider, t)!,
308324
loginOrDividerText: Color.lerp(loginOrDividerText, other.loginOrDividerText, t)!,
309325
sectionCollapseIcon: Color.lerp(sectionCollapseIcon, other.sectionCollapseIcon, t)!,

0 commit comments

Comments
 (0)