@@ -36,6 +36,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
36
36
return ContentTheme ._(
37
37
colorCodeBlockBackground: const HSLColor .fromAHSL (0.04 , 0 , 0 , 0 ).toColor (),
38
38
colorDirectMentionBackground: const HSLColor .fromAHSL (0.2 , 240 , 0.7 , 0.7 ).toColor (),
39
+ colorGlobalTimeBackground: const HSLColor .fromAHSL (1 , 0 , 0 , 0.93 ).toColor (),
39
40
colorMathBlockBorder: const HSLColor .fromAHSL (0.15 , 240 , 0.8 , 0.5 ).toColor (),
40
41
colorMessageMediaContainerBackground: const Color .fromRGBO (0 , 0 , 0 , 0.03 ),
41
42
colorThematicBreak: const HSLColor .fromAHSL (1 , 0 , 0 , .87 ).toColor (),
@@ -59,6 +60,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
59
60
return ContentTheme ._(
60
61
colorCodeBlockBackground: const HSLColor .fromAHSL (0.04 , 0 , 0 , 1 ).toColor (),
61
62
colorDirectMentionBackground: const HSLColor .fromAHSL (0.25 , 240 , 0.52 , 0.6 ).toColor (),
63
+ colorGlobalTimeBackground: const HSLColor .fromAHSL (0.2 , 0 , 0 , 0 ).toColor (),
62
64
colorMathBlockBorder: const HSLColor .fromAHSL (1 , 240 , 0.4 , 0.4 ).toColor (),
63
65
colorMessageMediaContainerBackground: const HSLColor .fromAHSL (0.03 , 0 , 0 , 1 ).toColor (),
64
66
colorThematicBreak: const HSLColor .fromAHSL (1 , 0 , 0 , .87 ).toColor ().withOpacity (0.2 ),
@@ -81,6 +83,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
81
83
ContentTheme ._({
82
84
required this .colorCodeBlockBackground,
83
85
required this .colorDirectMentionBackground,
86
+ required this .colorGlobalTimeBackground,
84
87
required this .colorMathBlockBorder,
85
88
required this .colorMessageMediaContainerBackground,
86
89
required this .colorThematicBreak,
@@ -104,6 +107,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
104
107
105
108
final Color colorCodeBlockBackground;
106
109
final Color colorDirectMentionBackground;
110
+ final Color colorGlobalTimeBackground;
107
111
final Color colorMathBlockBorder; // TODO(#46) this won't be needed
108
112
final Color colorMessageMediaContainerBackground;
109
113
final Color colorThematicBreak;
@@ -153,6 +157,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
153
157
ContentTheme copyWith ({
154
158
Color ? colorCodeBlockBackground,
155
159
Color ? colorDirectMentionBackground,
160
+ Color ? colorGlobalTimeBackground,
156
161
Color ? colorMathBlockBorder,
157
162
Color ? colorMessageMediaContainerBackground,
158
163
Color ? colorThematicBreak,
@@ -166,6 +171,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
166
171
return ContentTheme ._(
167
172
colorCodeBlockBackground: colorCodeBlockBackground ?? this .colorCodeBlockBackground,
168
173
colorDirectMentionBackground: colorDirectMentionBackground ?? this .colorDirectMentionBackground,
174
+ colorGlobalTimeBackground: colorGlobalTimeBackground ?? this .colorGlobalTimeBackground,
169
175
colorMathBlockBorder: colorMathBlockBorder ?? this .colorMathBlockBorder,
170
176
colorMessageMediaContainerBackground: colorMessageMediaContainerBackground ?? this .colorMessageMediaContainerBackground,
171
177
colorThematicBreak: colorThematicBreak ?? this .colorThematicBreak,
@@ -186,6 +192,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
186
192
return ContentTheme ._(
187
193
colorCodeBlockBackground: Color .lerp (colorCodeBlockBackground, other.colorCodeBlockBackground, t)! ,
188
194
colorDirectMentionBackground: Color .lerp (colorDirectMentionBackground, other.colorDirectMentionBackground, t)! ,
195
+ colorGlobalTimeBackground: Color .lerp (colorGlobalTimeBackground, other.colorGlobalTimeBackground, t)! ,
189
196
colorMathBlockBorder: Color .lerp (colorMathBlockBorder, other.colorMathBlockBorder, t)! ,
190
197
colorMessageMediaContainerBackground: Color .lerp (colorMessageMediaContainerBackground, other.colorMessageMediaContainerBackground, t)! ,
191
198
colorThematicBreak: Color .lerp (colorThematicBreak, other.colorThematicBreak, t)! ,
@@ -1117,7 +1124,6 @@ class GlobalTime extends StatelessWidget {
1117
1124
final GlobalTimeNode node;
1118
1125
final TextStyle ambientTextStyle;
1119
1126
1120
- static final _backgroundColor = const HSLColor .fromAHSL (1 , 0 , 0 , 0.93 ).toColor ();
1121
1127
static final _borderColor = const HSLColor .fromAHSL (1 , 0 , 0 , 0.8 ).toColor ();
1122
1128
static final _dateFormat = DateFormat ('EEE, MMM d, y, h:mm a' ); // TODO(intl): localize date
1123
1129
@@ -1126,11 +1132,12 @@ class GlobalTime extends StatelessWidget {
1126
1132
// Design taken from css for `.rendered_markdown & time` in web,
1127
1133
// see zulip:web/styles/rendered_markdown.css .
1128
1134
final text = _dateFormat.format (node.datetime.toLocal ());
1135
+ final contentTheme = ContentTheme .of (context);
1129
1136
return Padding (
1130
1137
padding: const EdgeInsets .symmetric (horizontal: 2 ),
1131
1138
child: DecoratedBox (
1132
1139
decoration: BoxDecoration (
1133
- color: _backgroundColor ,
1140
+ color: contentTheme.colorGlobalTimeBackground ,
1134
1141
border: Border .all (width: 1 , color: _borderColor),
1135
1142
borderRadius: BorderRadius .circular (3 )),
1136
1143
child: Padding (
0 commit comments