feat: Display emotes/emojis bigger

This commit is contained in:
Sorunome
2020-09-20 11:35:28 +02:00
parent 168b8b076f
commit 9cccd07643
5 changed files with 17 additions and 8 deletions

View File

@ -49,13 +49,16 @@ class MessageContent extends StatelessWidget {
if (event.messageType == MessageTypes.Emote) {
html = '* $html';
}
final bigEmotes = event.onlyEmotes && event.numberEmotes <= 10;
final fontSize = DefaultTextStyle.of(context).style.fontSize;
return HtmlMessage(
html: html,
defaultTextStyle: TextStyle(
color: textColor,
fontSize: DefaultTextStyle.of(context).style.fontSize,
fontSize: bigEmotes ? fontSize * 3 : fontSize,
),
room: event.room,
emoteSize: bigEmotes ? fontSize * 3 : fontSize * 1.5,
);
}
// else we fall through to the normal message rendering
@ -78,11 +81,13 @@ class MessageContent extends StatelessWidget {
onPressed: () => launch(event.body),
);
}
final bigEmotes = event.onlyEmotes && event.numberEmotes <= 10;
final fontSize = DefaultTextStyle.of(context).style.fontSize;
return LinkText(
text: event.getLocalizedBody(L10n.of(context), hideReply: true),
textStyle: TextStyle(
color: textColor,
fontSize: DefaultTextStyle.of(context).style.fontSize,
fontSize: bigEmotes ? fontSize * 3 : fontSize,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
onLinkTap: (url) => UrlLauncher(context, url).launchUrl(),