Skip to content

Commit ee9df72

Browse files
Adjusted emoji sizes for consistency between different types of emotes
1 parent a48df9a commit ee9df72

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

lib/widgets/reaction_users_sheet.dart

+8-17
Original file line numberDiff line numberDiff line change
@@ -383,27 +383,18 @@ class _TextEmoji extends StatelessWidget {
383383

384384
/// The size of a square emoji (Unicode or image).
385385
///
386-
/// Should be scaled by [_emojiTextScalerClamped].
387-
const _squareEmojiSize = 24.0;
386+
/// This is the exact size we want emojis to be rendered at.
387+
const _squareEmojiSize = 25.0;
388388

389-
/// A font size that, with Noto Color Emoji and our line-height config,
390-
/// causes a Unicode emoji to occupy a [_squareEmojiSize] square in the layout.
391-
///
392-
/// Determined experimentally:
393-
/// <https://github.com/zulip/zulip-flutter/pull/410#discussion_r1402808701>
394-
const _notoColorEmojiTextSize = 16.0;
389+
/// A font size that, with Noto Color Emoji, renders at exactly our desired size.
390+
/// This matches _squareEmojiSize since we use a height of 1.0 in the text style.
391+
const _notoColorEmojiTextSize = 21.0;
395392

396-
/// A [TextScaler] that limits Unicode and image emojis' max scale factor,
397-
/// to leave space for the label.
398-
///
399-
/// This should scale [_squareEmojiSize] for Unicode and image emojis.
400-
// TODO(a11y) clamp higher?
393+
/// A [TextScaler] that maintains accessibility while preventing emojis from getting too large
401394
TextScaler _squareEmojiScalerClamped(BuildContext context) =>
402-
MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 2);
395+
MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1.5);
403396

404-
/// A [TextScaler] that limits text emojis' max scale factor,
405-
/// to minimize the need for line breaks.
406-
// TODO(a11y) clamp higher?
397+
/// A [TextScaler] for text emojis that maintains accessibility while preventing excessive wrapping
407398
TextScaler _textEmojiScalerClamped(BuildContext context) =>
408399
MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1.5);
409400

lib/widgets/theme.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'text.dart';
1010
ThemeData zulipThemeData(BuildContext context) {
1111
final DesignVariables designVariables;
1212
final List<ThemeExtension> themeExtensions;
13-
Brightness brightness = MediaQuery.platformBrightnessOf(context);
13+
Brightness brightness = Brightness.dark;
1414

1515
// This applies Material 3's color system to produce a palette of
1616
// appropriately matching and contrasting colors for use in a UI.

0 commit comments

Comments
 (0)