Skip to content

Commit de53b7c

Browse files
committed
inbox [nfc]: Introduce muted property to AtMentionMarker
1 parent f9ba7df commit de53b7c

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

lib/widgets/inbox.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ abstract class _HeaderItem extends StatelessWidget {
282282
overflow: TextOverflow.ellipsis,
283283
title))),
284284
const SizedBox(width: 12),
285-
if (hasMention) const AtMentionMarker(),
285+
if (hasMention) const AtMentionMarker(muted: false),
286286
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
287287
child: UnreadCountBadge(
288288
backgroundColor: unreadCountBadgeBackgroundColor(context),
@@ -405,7 +405,7 @@ class _DmItem extends StatelessWidget {
405405
overflow: TextOverflow.ellipsis,
406406
title))),
407407
const SizedBox(width: 12),
408-
if (hasMention) const AtMentionMarker(),
408+
if (hasMention) const AtMentionMarker(muted: false),
409409
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
410410
child: UnreadCountBadge(backgroundColor: null,
411411
count: count)),
@@ -530,7 +530,7 @@ class _TopicItem extends StatelessWidget {
530530
overflow: TextOverflow.ellipsis,
531531
topic))),
532532
const SizedBox(width: 12),
533-
if (hasMention) const AtMentionMarker(),
533+
if (hasMention) const AtMentionMarker(muted: false),
534534
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
535535
child: UnreadCountBadge(
536536
backgroundColor: colorSwatchFor(context, subscription),

lib/widgets/theme.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
116116
mainBackground: const Color(0xfff0f0f0),
117117
title: const Color(0xff1a1a1a),
118118
channelColorSwatches: ChannelColorSwatches.light,
119-
atMentionMarker: const HSLColor.fromAHSL(0.5, 0, 0, 0.2).toColor(),
119+
atMentionMarker: const HSLColor.fromAHSL(0.7, 0, 0, 0.2).toColor(),
120+
mutedAtMentionMarker: const HSLColor.fromAHSL(0.35, 0, 0, 0.2).toColor(),
120121
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor(),
121122
errorBannerBackground: const HSLColor.fromAHSL(1, 4, 0.33, 0.90).toColor(),
122123
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.57, 0.33).toColor(),
@@ -145,7 +146,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
145146
title: const Color(0xffffffff),
146147
channelColorSwatches: ChannelColorSwatches.dark,
147148
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
148-
atMentionMarker: const HSLColor.fromAHSL(0.4, 0, 0, 1).toColor(),
149+
atMentionMarker: const HSLColor.fromAHSL(0.7, 0, 0, 1).toColor(),
150+
mutedAtMentionMarker: const HSLColor.fromAHSL(0.4, 0, 0, 1).toColor(),
149151
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.15, 0.2).toColor(),
150152
errorBannerBackground: const HSLColor.fromAHSL(1, 0, 0.61, 0.19).toColor(),
151153
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.73, 0.74).toColor(),
@@ -179,6 +181,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
179181
required this.title,
180182
required this.channelColorSwatches,
181183
required this.atMentionMarker,
184+
required this.mutedAtMentionMarker,
182185
required this.dmHeaderBg,
183186
required this.errorBannerBackground,
184187
required this.errorBannerBorder,
@@ -219,6 +222,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
219222

220223
// Not named variables in Figma; taken from older Figma drafts, or elsewhere.
221224
final Color atMentionMarker;
225+
final Color mutedAtMentionMarker;
222226
final Color dmHeaderBg;
223227
final Color errorBannerBackground;
224228
final Color errorBannerBorder;
@@ -246,6 +250,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
246250
Color? title,
247251
ChannelColorSwatches? channelColorSwatches,
248252
Color? atMentionMarker,
253+
Color? mutedAtMentionMarker,
249254
Color? dmHeaderBg,
250255
Color? errorBannerBackground,
251256
Color? errorBannerBorder,
@@ -272,6 +277,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
272277
title: title ?? this.title,
273278
channelColorSwatches: channelColorSwatches ?? this.channelColorSwatches,
274279
atMentionMarker: atMentionMarker ?? this.atMentionMarker,
280+
mutedAtMentionMarker: mutedAtMentionMarker ?? this.mutedAtMentionMarker,
275281
dmHeaderBg: dmHeaderBg ?? this.dmHeaderBg,
276282
errorBannerBackground: errorBannerBackground ?? this.errorBannerBackground,
277283
errorBannerBorder: errorBannerBorder ?? this.errorBannerBorder,
@@ -305,6 +311,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
305311
title: Color.lerp(title, other.title, t)!,
306312
channelColorSwatches: ChannelColorSwatches.lerp(channelColorSwatches, other.channelColorSwatches, t),
307313
atMentionMarker: Color.lerp(atMentionMarker, other.atMentionMarker, t)!,
314+
mutedAtMentionMarker: Color.lerp(mutedAtMentionMarker, other.mutedAtMentionMarker, t)!,
308315
dmHeaderBg: Color.lerp(dmHeaderBg, other.dmHeaderBg, t)!,
309316
errorBannerBackground: Color.lerp(errorBannerBackground, other.errorBannerBackground, t)!,
310317
errorBannerBorder: Color.lerp(errorBannerBorder, other.errorBannerBorder, t)!,

lib/widgets/unread_count_badge.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ class MutedUnreadBadge extends StatelessWidget {
7575
}
7676

7777
class AtMentionMarker extends StatelessWidget {
78-
const AtMentionMarker({super.key});
78+
const AtMentionMarker({super.key, required this.muted});
79+
80+
final bool muted;
7981

8082
@override
8183
Widget build(BuildContext context) {
@@ -84,6 +86,9 @@ class AtMentionMarker extends StatelessWidget {
8486
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?type=design&node-id=224-16386&mode=design&t=JsNndFQ8fKFH0SjS-0
8587
return Padding(
8688
padding: const EdgeInsetsDirectional.only(end: 4),
87-
child: Icon(ZulipIcons.at_sign, size: 14, color: designVariables.atMentionMarker));
89+
child: Icon(
90+
ZulipIcons.at_sign,
91+
size: 14,
92+
color: muted ? designVariables.mutedAtMentionMarker : designVariables.atMentionMarker));
8893
}
8994
}

0 commit comments

Comments
 (0)