@@ -40,6 +40,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
40
40
return ContentTheme ._(
41
41
colorCodeBlockBackground: const HSLColor .fromAHSL (0.04 , 0 , 0 , 0 ).toColor (),
42
42
colorDirectMentionBackground: const HSLColor .fromAHSL (0.2 , 240 , 0.7 , 0.7 ).toColor (),
43
+ colorTopicMentionBackground: const HSLColor .fromAHSL (0.18 , 183 , 0.6 , 0.45 ).toColor (),
43
44
colorGlobalTimeBackground: const HSLColor .fromAHSL (1 , 0 , 0 , 0.93 ).toColor (),
44
45
colorGlobalTimeBorder: const HSLColor .fromAHSL (1 , 0 , 0 , 0.8 ).toColor (),
45
46
colorMathBlockBorder: const HSLColor .fromAHSL (0.15 , 240 , 0.8 , 0.5 ).toColor (),
@@ -69,6 +70,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
69
70
return ContentTheme ._(
70
71
colorCodeBlockBackground: const HSLColor .fromAHSL (0.04 , 0 , 0 , 1 ).toColor (),
71
72
colorDirectMentionBackground: const HSLColor .fromAHSL (0.25 , 240 , 0.52 , 0.6 ).toColor (),
73
+ colorTopicMentionBackground: const HSLColor .fromAHSL (0.18 , 183 , 0.52 , 0.40 ).toColor (),
72
74
colorGlobalTimeBackground: const HSLColor .fromAHSL (0.2 , 0 , 0 , 0 ).toColor (),
73
75
colorGlobalTimeBorder: const HSLColor .fromAHSL (0.4 , 0 , 0 , 0 ).toColor (),
74
76
colorMathBlockBorder: const HSLColor .fromAHSL (1 , 240 , 0.4 , 0.4 ).toColor (),
@@ -97,6 +99,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
97
99
ContentTheme ._({
98
100
required this .colorCodeBlockBackground,
99
101
required this .colorDirectMentionBackground,
102
+ required this .colorTopicMentionBackground,
100
103
required this .colorGlobalTimeBackground,
101
104
required this .colorGlobalTimeBorder,
102
105
required this .colorMathBlockBorder,
@@ -126,6 +129,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
126
129
127
130
final Color colorCodeBlockBackground;
128
131
final Color colorDirectMentionBackground;
132
+ final Color colorTopicMentionBackground;
129
133
final Color colorGlobalTimeBackground;
130
134
final Color colorGlobalTimeBorder;
131
135
final Color colorMathBlockBorder; // TODO(#46) this won't be needed
@@ -181,6 +185,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
181
185
ContentTheme copyWith ({
182
186
Color ? colorCodeBlockBackground,
183
187
Color ? colorDirectMentionBackground,
188
+ Color ? colorTopicMentionBackground,
184
189
Color ? colorGlobalTimeBackground,
185
190
Color ? colorGlobalTimeBorder,
186
191
Color ? colorMathBlockBorder,
@@ -200,6 +205,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
200
205
return ContentTheme ._(
201
206
colorCodeBlockBackground: colorCodeBlockBackground ?? this .colorCodeBlockBackground,
202
207
colorDirectMentionBackground: colorDirectMentionBackground ?? this .colorDirectMentionBackground,
208
+ colorTopicMentionBackground: colorTopicMentionBackground ?? this .colorTopicMentionBackground,
203
209
colorGlobalTimeBackground: colorGlobalTimeBackground ?? this .colorGlobalTimeBackground,
204
210
colorGlobalTimeBorder: colorGlobalTimeBorder ?? this .colorGlobalTimeBorder,
205
211
colorMathBlockBorder: colorMathBlockBorder ?? this .colorMathBlockBorder,
@@ -226,6 +232,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
226
232
return ContentTheme ._(
227
233
colorCodeBlockBackground: Color .lerp (colorCodeBlockBackground, other.colorCodeBlockBackground, t)! ,
228
234
colorDirectMentionBackground: Color .lerp (colorDirectMentionBackground, other.colorDirectMentionBackground, t)! ,
235
+ colorTopicMentionBackground: Color .lerp (colorTopicMentionBackground, other.colorTopicMentionBackground, t)! ,
229
236
colorGlobalTimeBackground: Color .lerp (colorGlobalTimeBackground, other.colorGlobalTimeBackground, t)! ,
230
237
colorGlobalTimeBorder: Color .lerp (colorGlobalTimeBorder, other.colorGlobalTimeBorder, t)! ,
231
238
colorMathBlockBorder: Color .lerp (colorMathBlockBorder, other.colorMathBlockBorder, t)! ,
@@ -1081,7 +1088,10 @@ class Mention extends StatelessWidget {
1081
1088
return Container (
1082
1089
decoration: BoxDecoration (
1083
1090
// TODO(#646) different for wildcard mentions
1084
- color: contentTheme.colorDirectMentionBackground,
1091
+ color: switch (node) {
1092
+ UserMentionNode () => contentTheme.colorDirectMentionBackground,
1093
+ TopicMentionNode () => contentTheme.colorTopicMentionBackground,
1094
+ },
1085
1095
borderRadius: const BorderRadius .all (Radius .circular (3 ))),
1086
1096
padding: const EdgeInsets .symmetric (horizontal: 0.2 * kBaseFontSize),
1087
1097
child: InlineContent (
0 commit comments