Skip to content

Commit 2e18afd

Browse files
committed
inbox [nfc]: Introduce muted property to AtMentionMarker
1 parent 195c1de commit 2e18afd

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
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: true),
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: true),
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: true),
534534
Padding(padding: const EdgeInsetsDirectional.only(end: 16),
535535
child: UnreadCountBadge(
536536
backgroundColor: colorSwatchFor(context, subscription),

lib/widgets/theme.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,14 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
114114
mainBackground: const Color(0xfff0f0f0),
115115
title: const Color(0xff1a1a1a),
116116
channelColorSwatches: ChannelColorSwatches.light,
117-
atMentionMarker: const HSLColor.fromAHSL(0.5, 0, 0, 0.2).toColor(),
117+
atMentionMarker: const HSLColor.fromAHSL(0.7, 0, 0, 0.2).toColor(),
118+
mutedAtMentionMarker: const HSLColor.fromAHSL(0.5, 0, 0, 0.2).toColor(),
118119
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor(),
119120
errorBannerBackground: const HSLColor.fromAHSL(1, 4, 0.33, 0.90).toColor(),
120121
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.57, 0.33).toColor(),
121122
errorBannerLabel: const HSLColor.fromAHSL(1, 4, 0.58, 0.33).toColor(),
122123
groupDmConversationIcon: Colors.black.withOpacity(0.5),
123-
groupDmConversationIconBg: const Color(0x33808080),
124+
groupDmConversationIconBg: const Color.fromARGB(51, 6, 0, 0),
124125
loginOrDivider: const Color(0xffdedede),
125126
loginOrDividerText: const Color(0xff575757),
126127
sectionCollapseIcon: const Color(0x7f1e2e48),
@@ -143,7 +144,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
143144
title: const Color(0xffffffff),
144145
channelColorSwatches: ChannelColorSwatches.dark,
145146
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
146-
atMentionMarker: const HSLColor.fromAHSL(0.4, 0, 0, 1).toColor(),
147+
atMentionMarker: const HSLColor.fromAHSL(0.7, 0, 0, 1).toColor(),
148+
mutedAtMentionMarker: const HSLColor.fromAHSL(0.4, 0, 0, 1).toColor(),
147149
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.15, 0.2).toColor(),
148150
errorBannerBackground: const HSLColor.fromAHSL(1, 0, 0.61, 0.19).toColor(),
149151
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.73, 0.74).toColor(),
@@ -177,6 +179,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
177179
required this.title,
178180
required this.channelColorSwatches,
179181
required this.atMentionMarker,
182+
required this.mutedAtMentionMarker,
180183
required this.dmHeaderBg,
181184
required this.errorBannerBackground,
182185
required this.errorBannerBorder,
@@ -217,6 +220,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
217220

218221
// Not named variables in Figma; taken from older Figma drafts, or elsewhere.
219222
final Color atMentionMarker;
223+
final Color mutedAtMentionMarker;
220224
final Color dmHeaderBg;
221225
final Color errorBannerBackground;
222226
final Color errorBannerBorder;
@@ -244,6 +248,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
244248
Color? title,
245249
ChannelColorSwatches? channelColorSwatches,
246250
Color? atMentionMarker,
251+
Color? mutedAtMentionMarker,
247252
Color? dmHeaderBg,
248253
Color? errorBannerBackground,
249254
Color? errorBannerBorder,
@@ -270,6 +275,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
270275
title: title ?? this.title,
271276
channelColorSwatches: channelColorSwatches ?? this.channelColorSwatches,
272277
atMentionMarker: atMentionMarker ?? this.atMentionMarker,
278+
mutedAtMentionMarker: mutedAtMentionMarker ?? this.mutedAtMentionMarker,
273279
dmHeaderBg: dmHeaderBg ?? this.dmHeaderBg,
274280
errorBannerBackground: errorBannerBackground ?? this.errorBannerBackground,
275281
errorBannerBorder: errorBannerBorder ?? this.errorBannerBorder,
@@ -303,6 +309,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
303309
title: Color.lerp(title, other.title, t)!,
304310
channelColorSwatches: ChannelColorSwatches.lerp(channelColorSwatches, other.channelColorSwatches, t),
305311
atMentionMarker: Color.lerp(atMentionMarker, other.atMentionMarker, t)!,
312+
mutedAtMentionMarker: Color.lerp(mutedAtMentionMarker, other.mutedAtMentionMarker, t)!,
306313
dmHeaderBg: Color.lerp(dmHeaderBg, other.dmHeaderBg, t)!,
307314
errorBannerBackground: Color.lerp(errorBannerBackground, other.errorBannerBackground, t)!,
308315
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)