Skip to content

Commit b40c51d

Browse files
theme: Replace dateSeparatorText & messageTimestamp with labelTime
The `dateSeparatorText` and `messageTimestamp`, which define the color of the date and time stamps on messages and message headers, have been replaced with a lower-contrast version in both dark and light themes. This is done using a new `labelTime` variable in `MessageListTheme`, aligning with the Figma Design. Figma: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=4993-20811&t=QCuXEn8bYVbf4Fli-0 discussion: zulip#1213 (comment)
1 parent 14ec020 commit b40c51d

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

lib/widgets/message_list.dart

+9-16
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ import 'theme.dart';
3030
class MessageListTheme extends ThemeExtension<MessageListTheme> {
3131
static final light = MessageListTheme._(
3232
dateSeparator: Colors.black,
33-
dateSeparatorText: const HSLColor.fromAHSL(0.75, 0, 0, 0.15).toColor(),
3433
dmRecipientHeaderBg: const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor(),
35-
messageTimestamp: const HSLColor.fromAHSL(0.8, 0, 0, 0.2).toColor(),
34+
labelTime: const HSLColor.fromAHSL(0.49, 0, 0, 0).toColor(),
3635
recipientHeaderText: const HSLColor.fromAHSL(1, 0, 0, 0.15).toColor(),
3736
senderBotIcon: const HSLColor.fromAHSL(1, 180, 0.08, 0.65).toColor(),
3837
senderName: const HSLColor.fromAHSL(1, 0, 0, 0.2).toColor(),
@@ -55,9 +54,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
5554

5655
static final dark = MessageListTheme._(
5756
dateSeparator: Colors.white,
58-
dateSeparatorText: const HSLColor.fromAHSL(0.75, 0, 0, 1).toColor(),
5957
dmRecipientHeaderBg: const HSLColor.fromAHSL(1, 46, 0.15, 0.2).toColor(),
60-
messageTimestamp: const HSLColor.fromAHSL(0.8, 0, 0, 0.85).toColor(),
58+
labelTime: const HSLColor.fromAHSL(0.5, 0, 0, 1).toColor(),
6159
recipientHeaderText: const HSLColor.fromAHSL(0.8, 0, 0, 1).toColor(),
6260
senderBotIcon: const HSLColor.fromAHSL(1, 180, 0.05, 0.5).toColor(),
6361
senderName: const HSLColor.fromAHSL(0.85, 0, 0, 1).toColor(),
@@ -79,9 +77,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
7977

8078
MessageListTheme._({
8179
required this.dateSeparator,
82-
required this.dateSeparatorText,
8380
required this.dmRecipientHeaderBg,
84-
required this.messageTimestamp,
81+
required this.labelTime,
8582
required this.recipientHeaderText,
8683
required this.senderBotIcon,
8784
required this.senderName,
@@ -103,9 +100,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
103100
}
104101

105102
final Color dateSeparator;
106-
final Color dateSeparatorText;
107103
final Color dmRecipientHeaderBg;
108-
final Color messageTimestamp;
104+
final Color labelTime;
109105
final Color recipientHeaderText;
110106
final Color senderBotIcon;
111107
final Color senderName;
@@ -118,9 +114,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
118114
@override
119115
MessageListTheme copyWith({
120116
Color? dateSeparator,
121-
Color? dateSeparatorText,
122117
Color? dmRecipientHeaderBg,
123-
Color? messageTimestamp,
118+
Color? labelTime,
124119
Color? recipientHeaderText,
125120
Color? senderBotIcon,
126121
Color? senderName,
@@ -132,9 +127,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
132127
}) {
133128
return MessageListTheme._(
134129
dateSeparator: dateSeparator ?? this.dateSeparator,
135-
dateSeparatorText: dateSeparatorText ?? this.dateSeparatorText,
136130
dmRecipientHeaderBg: dmRecipientHeaderBg ?? this.dmRecipientHeaderBg,
137-
messageTimestamp: messageTimestamp ?? this.messageTimestamp,
131+
labelTime: labelTime ?? this.labelTime,
138132
recipientHeaderText: recipientHeaderText ?? this.recipientHeaderText,
139133
senderBotIcon: senderBotIcon ?? this.senderBotIcon,
140134
senderName: senderName ?? this.senderName,
@@ -153,9 +147,8 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
153147
}
154148
return MessageListTheme._(
155149
dateSeparator: Color.lerp(dateSeparator, other.dateSeparator, t)!,
156-
dateSeparatorText: Color.lerp(dateSeparatorText, other.dateSeparatorText, t)!,
157150
dmRecipientHeaderBg: Color.lerp(dmRecipientHeaderBg, other.dmRecipientHeaderBg, t)!,
158-
messageTimestamp: Color.lerp(messageTimestamp, other.messageTimestamp, t)!,
151+
labelTime: Color.lerp(labelTime, other.labelTime, t)!,
159152
recipientHeaderText: Color.lerp(recipientHeaderText, other.recipientHeaderText, t)!,
160153
senderBotIcon: Color.lerp(senderBotIcon, other.senderBotIcon, t)!,
161154
senderName: Color.lerp(senderName, other.senderName, t)!,
@@ -1263,7 +1256,7 @@ class DateText extends StatelessWidget {
12631256
final zulipLocalizations = ZulipLocalizations.of(context);
12641257
return Text(
12651258
style: TextStyle(
1266-
color: messageListTheme.dateSeparatorText,
1259+
color: messageListTheme.labelTime,
12671260
fontSize: fontSize,
12681261
height: height,
12691262
// This is equivalent to css `all-small-caps`, see:
@@ -1370,7 +1363,7 @@ class MessageWithPossibleSender extends StatelessWidget {
13701363
const SizedBox(width: 4),
13711364
Text(time,
13721365
style: TextStyle(
1373-
color: messageListTheme.messageTimestamp,
1366+
color: messageListTheme.labelTime,
13741367
fontSize: 16,
13751368
height: (18 / 16),
13761369
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],

0 commit comments

Comments
 (0)