diff --git a/lib/components/html_message.dart b/lib/components/html_message.dart
index 57b0a1f7..1c7f0f9f 100644
--- a/lib/components/html_message.dart
+++ b/lib/components/html_message.dart
@@ -7,19 +7,25 @@ import 'matrix.dart';
class HtmlMessage extends StatelessWidget {
final String html;
- final Color textColor;
final int maxLines;
final Room room;
+ final TextStyle defaultTextStyle;
+ final TextStyle linkStyle;
- const HtmlMessage({this.html, this.textColor, this.maxLines, this.room});
+ const HtmlMessage({this.html, this.maxLines, this.room, this.defaultTextStyle, this.linkStyle});
@override
Widget build(BuildContext context) {
// there is no need to pre-validate the html, as we validate it while rendering
+ final themeData = Theme.of(context);
return Html(
data: html,
- defaultTextStyle: TextStyle(color: textColor),
+ defaultTextStyle: defaultTextStyle,
+ linkStyle: linkStyle ?? themeData.textTheme.bodyText2.copyWith(
+ color: themeData.accentColor,
+ decoration: TextDecoration.underline,
+ ),
shrinkToFit: true,
maxLines: maxLines,
onLinkTap: (String url) {
diff --git a/lib/components/message_content.dart b/lib/components/message_content.dart
index 0fb3028a..d2f48978 100644
--- a/lib/components/message_content.dart
+++ b/lib/components/message_content.dart
@@ -51,7 +51,10 @@ class MessageContent extends StatelessWidget {
}
return HtmlMessage(
html: html,
- textColor: textColor,
+ defaultTextStyle: TextStyle(
+ color: textColor,
+ fontSize: DefaultTextStyle.of(context).style.fontSize,
+ ),
room: event.room,
);
}
@@ -79,6 +82,7 @@ class MessageContent extends StatelessWidget {
text: event.getLocalizedBody(L10n.of(context), hideReply: true),
textStyle: TextStyle(
color: textColor,
+ fontSize: DefaultTextStyle.of(context).style.fontSize,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
);
diff --git a/lib/components/reply_content.dart b/lib/components/reply_content.dart
index 432888a5..9c28a4b2 100644
--- a/lib/components/reply_content.dart
+++ b/lib/components/reply_content.dart
@@ -29,9 +29,12 @@ class ReplyContent extends StatelessWidget {
}
replyBody = HtmlMessage(
html: html,
- textColor: lightText
+ defaultTextStyle: TextStyle(
+ color: lightText
? Colors.white
: Theme.of(context).textTheme.bodyText2.color,
+ fontSize: DefaultTextStyle.of(context).style.fontSize,
+ ),
maxLines: 1,
room: replyEvent.room,
);
@@ -46,9 +49,11 @@ class ReplyContent extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
- color: lightText
- ? Colors.white
- : Theme.of(context).textTheme.bodyText2.color),
+ color: lightText
+ ? Colors.white
+ : Theme.of(context).textTheme.bodyText2.color,
+ fontSize: DefaultTextStyle.of(context).style.fontSize,
+ ),
);
}
return Row(