Skip to content

Commit 87d149c

Browse files
committed
autocomplete: Update emoji-results style to follow design
This follows the new design for user-mention results, but adapted for emoji based on the design for the emoji picker. See comment for details.
1 parent bff25ad commit 87d149c

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

lib/widgets/autocomplete.dart

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,13 @@ class _EmojiAutocompleteItem extends StatelessWidget {
287287

288288
final EmojiAutocompleteResult option;
289289

290-
// TODO adjust sizes to match _MentionAutocompleteItem avatar
291-
static const _size = 32.0;
292-
static const _notoColorEmojiTextSize = 25.7;
290+
static const _size = 24.0;
291+
static const _notoColorEmojiTextSize = 19.3;
293292

294293
@override
295294
Widget build(BuildContext context) {
296295
final store = PerAccountStoreWidget.of(context);
296+
final designVariables = DesignVariables.of(context);
297297
final candidate = option.candidate;
298298

299299
final emojiDisplay = candidate.emojiDisplay.resolve(store.userSettings);
@@ -311,16 +311,31 @@ class _EmojiAutocompleteItem extends StatelessWidget {
311311
? candidate.emojiName
312312
: [candidate.emojiName, ...candidate.aliases].join(", "); // TODO(#1080)
313313

314+
// TODO(design): emoji autocomplete results
315+
// There's no design in Figma for emoji autocomplete results.
316+
// Instead we adapt the design for the emoji picker to the
317+
// context of autocomplete results as exemplified by _MentionAutocompleteItem.
318+
// That means: emoji size, text size, text line-height from emoji picker;
319+
// text color (for contrast with background) and outer padding
320+
// from _MentionAutocompleteItem; padding around emoji glyph
321+
// to bring it to same size as avatar in _MentionAutocompleteItem.
314322
return Padding(
315323
padding: const EdgeInsetsDirectional.fromSTEB(4, 4, 8, 4),
316324
child: Row(children: [
317325
if (glyph != null) ...[
318-
glyph,
326+
Padding(padding: const EdgeInsets.all(6),
327+
child: glyph),
319328
const SizedBox(width: 6),
320329
],
321-
// TODO adjust text style to match _MentionAutocompleteItem
322330
Expanded(
323331
child: Text(
332+
// The Figma design for the emoji picker actually calls for the
333+
// line-height to be 24px when the label fits on one line,
334+
// and 18px when it wraps. But whether it'll wrap is something we
335+
// don't know at build time, so make it always 18px. Discussion:
336+
// https://github.com/zulip/zulip-flutter/pull/995#discussion_r1868352275
337+
style: TextStyle(fontSize: 17, height: 18 / 17,
338+
color: designVariables.contextMenuItemLabel),
324339
maxLines: 2,
325340
overflow: TextOverflow.ellipsis,
326341
label)),

0 commit comments

Comments
 (0)