Merge pull request #3099 from pangeachat/3097-mention-stays-adjusted-size-in-practice-mode
chore: make text size match for matrix pill widget
This commit is contained in:
commit
fd3958800f
2 changed files with 11 additions and 5 deletions
|
|
@ -407,7 +407,10 @@ class HtmlMessage extends StatelessWidget {
|
|||
avatar: user.avatarUrl,
|
||||
uri: href,
|
||||
outerContext: context,
|
||||
fontSize: fontSize,
|
||||
// #Pangea
|
||||
// fontSize: fontSize,
|
||||
fontSize: renderer.fontSize(context),
|
||||
// Pangea#
|
||||
color: linkStyle.color,
|
||||
// #Pangea
|
||||
userId: user.id,
|
||||
|
|
@ -428,7 +431,10 @@ class HtmlMessage extends StatelessWidget {
|
|||
avatar: room?.avatar,
|
||||
uri: href,
|
||||
outerContext: context,
|
||||
fontSize: fontSize,
|
||||
// #Pangea
|
||||
// fontSize: fontSize,
|
||||
fontSize: renderer.fontSize(context),
|
||||
// Pangea#
|
||||
color: linkStyle.color,
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class TokenRenderingUtil {
|
|||
return readingAssistanceMode == ReadingAssistanceMode.transitionMode;
|
||||
}
|
||||
|
||||
double? _fontSize(BuildContext context) => showCenterStyling
|
||||
double? fontSize(BuildContext context) => showCenterStyling
|
||||
? overlayController != null && overlayController!.maxWidth > 600
|
||||
? Theme.of(context).textTheme.titleLarge?.fontSize
|
||||
: Theme.of(context).textTheme.bodyLarge?.fontSize
|
||||
|
|
@ -38,14 +38,14 @@ class TokenRenderingUtil {
|
|||
Color? color,
|
||||
}) =>
|
||||
existingStyle.copyWith(
|
||||
fontSize: _fontSize(context),
|
||||
fontSize: fontSize(context),
|
||||
decoration: TextDecoration.underline,
|
||||
decorationThickness: 4,
|
||||
decorationColor: color ?? Colors.white.withAlpha(0),
|
||||
);
|
||||
|
||||
double tokenTextWidthForContainer(BuildContext context, String text) {
|
||||
final tokenSizeKey = "$text-${_fontSize(context)}";
|
||||
final tokenSizeKey = "$text-${fontSize(context)}";
|
||||
if (_tokensWidthCache.containsKey(tokenSizeKey)) {
|
||||
return _tokensWidthCache[tokenSizeKey]!;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue