Skip to content

Commit 56f8fdb

Browse files
theme[nfc]: Remove colorMessageHeaderIconInteractive
Removed `colorMessageHeaderIconInteractive` from `DesignVariables` and used `title` in place of it as per the design guidelines.
1 parent 69471f0 commit 56f8fdb

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

lib/widgets/message_list.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class MessageListAppBarTitle extends StatelessWidget {
345345
padding: const EdgeInsetsDirectional.only(start: 4),
346346
child: Icon(icon,
347347
// TODO(design) copies the recipient header in web; is there a better color?
348-
color: designVariables.colorMessageHeaderIconInteractive, size: 14)),
348+
color: designVariables.title, size: 14)),
349349
]);
350350
}
351351

@@ -1091,7 +1091,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
10911091
style: recipientHeaderTextStyle(context))),
10921092
const SizedBox(width: 4),
10931093
// TODO(design) copies the recipient header in web; is there a better color?
1094-
Icon(size: 14, color: designVariables.colorMessageHeaderIconInteractive,
1094+
Icon(size: 14, color: designVariables.title,
10951095
// A null [Icon.icon] makes a blank space.
10961096
iconDataForTopicVisibilityPolicy(
10971097
store.topicVisibilityPolicy(message.streamId, topic))),

lib/widgets/theme.dart

+4-13
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ThemeData zulipThemeData(BuildContext context) {
2626

2727
switch (brightness) {
2828
case Brightness.light: {
29-
designVariables = DesignVariables.light();
29+
designVariables = DesignVariables.light;
3030
themeExtensions = [
3131
ContentTheme.light(context),
3232
designVariables,
@@ -35,7 +35,7 @@ ThemeData zulipThemeData(BuildContext context) {
3535
];
3636
}
3737
case Brightness.dark: {
38-
designVariables = DesignVariables.dark();
38+
designVariables = DesignVariables.dark;
3939
themeExtensions = [
4040
ContentTheme.dark(context),
4141
designVariables,
@@ -117,8 +117,7 @@ const kZulipBrandColor = Color.fromRGBO(0x64, 0x92, 0xfe, 1);
117117
/// or
118118
/// https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=2945-49492&t=MEb4vtp7S26nntxm-0
119119
class DesignVariables extends ThemeExtension<DesignVariables> {
120-
DesignVariables.light() :
121-
this._(
120+
static final light = DesignVariables._(
122121
background: const Color(0xffffffff),
123122
bannerBgIntDanger: const Color(0xfff2e4e4),
124123
bgBotBar: const Color(0xfff6f6f6),
@@ -148,7 +147,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
148147
bgSearchInput: const Color(0xffe3e3e3),
149148
textMessage: const Color(0xff262626),
150149
channelColorSwatches: ChannelColorSwatches.light,
151-
colorMessageHeaderIconInteractive: Colors.black.withValues(alpha: 0.2),
152150
contextMenuCancelBg: const Color(0xff797986).withValues(alpha: 0.15),
153151
contextMenuCancelPressedBg: const Color(0xff797986).withValues(alpha: 0.20),
154152
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor(),
@@ -167,8 +165,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
167165
unreadCountBadgeTextForChannel: Colors.black.withValues(alpha: 0.9),
168166
);
169167

170-
DesignVariables.dark() :
171-
this._(
168+
static final dark = DesignVariables._(
172169
background: const Color(0xff000000),
173170
bannerBgIntDanger: const Color(0xff461616),
174171
bgBotBar: const Color(0xff222222),
@@ -201,7 +198,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
201198
contextMenuCancelBg: const Color(0xff797986).withValues(alpha: 0.15), // the same as the light mode in Figma
202199
contextMenuCancelPressedBg: const Color(0xff797986).withValues(alpha: 0.20), // the same as the light mode in Figma
203200
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
204-
colorMessageHeaderIconInteractive: Colors.white.withValues(alpha: 0.2),
205201
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.15, 0.2).toColor(),
206202
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
207203
groupDmConversationIcon: Colors.white.withValues(alpha: 0.5),
@@ -255,7 +251,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
255251
required this.bgSearchInput,
256252
required this.textMessage,
257253
required this.channelColorSwatches,
258-
required this.colorMessageHeaderIconInteractive,
259254
required this.contextMenuCancelBg,
260255
required this.contextMenuCancelPressedBg,
261256
required this.dmHeaderBg,
@@ -317,7 +312,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
317312
final ChannelColorSwatches channelColorSwatches;
318313

319314
// Not named variables in Figma; taken from older Figma drafts, or elsewhere.
320-
final Color colorMessageHeaderIconInteractive;
321315
final Color contextMenuCancelBg; // In Figma, but unnamed.
322316
final Color contextMenuCancelPressedBg; // In Figma, but unnamed.
323317
final Color dmHeaderBg;
@@ -366,7 +360,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
366360
Color? bgSearchInput,
367361
Color? textMessage,
368362
ChannelColorSwatches? channelColorSwatches,
369-
Color? colorMessageHeaderIconInteractive,
370363
Color? contextMenuCancelBg,
371364
Color? contextMenuCancelPressedBg,
372365
Color? dmHeaderBg,
@@ -414,7 +407,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
414407
bgSearchInput: bgSearchInput ?? this.bgSearchInput,
415408
textMessage: textMessage ?? this.textMessage,
416409
channelColorSwatches: channelColorSwatches ?? this.channelColorSwatches,
417-
colorMessageHeaderIconInteractive: colorMessageHeaderIconInteractive ?? this.colorMessageHeaderIconInteractive,
418410
contextMenuCancelBg: contextMenuCancelBg ?? this.contextMenuCancelBg,
419411
contextMenuCancelPressedBg: contextMenuCancelPressedBg ?? this.contextMenuCancelPressedBg,
420412
dmHeaderBg: dmHeaderBg ?? this.dmHeaderBg,
@@ -469,7 +461,6 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
469461
bgSearchInput: Color.lerp(bgSearchInput, other.bgSearchInput, t)!,
470462
textMessage: Color.lerp(textMessage, other.textMessage, t)!,
471463
channelColorSwatches: ChannelColorSwatches.lerp(channelColorSwatches, other.channelColorSwatches, t),
472-
colorMessageHeaderIconInteractive: Color.lerp(colorMessageHeaderIconInteractive, other.colorMessageHeaderIconInteractive, t)!,
473464
contextMenuCancelBg: Color.lerp(contextMenuCancelBg, other.contextMenuCancelBg, t)!,
474465
contextMenuCancelPressedBg: Color.lerp(contextMenuCancelPressedBg, other.contextMenuCancelPressedBg, t)!,
475466
dmHeaderBg: Color.lerp(dmHeaderBg, other.dmHeaderBg, t)!,

0 commit comments

Comments
 (0)