Skip to content

Commit

Permalink
text: Use proportionalLetterSpacing in the few existing places that w…
Browse files Browse the repository at this point in the history
…ant it

The letter spacings in these pieces of text hasn't been responding
to system font-size adjustments. Now they do.

There might not be any other instances of this problem in the app,
because we widely apply 0 for [TextStyle.letterSpacing] (since
0065954), and when we do that, it shouldn't matter whether zero is
considered as logical pixels or as a proportion the surrounding text
size.
  • Loading branch information
chrisbobbe committed Apr 24, 2024
1 parent 23fe988 commit a500b0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
final textStyle = TextStyle(
color: contrastingColor,
fontSize: 16,
letterSpacing: 0.02 * 16,
letterSpacing: proportionalLetterSpacing(context, 0.02, baseFontSize: 16),
height: (18 / 16),
).merge(weightVariableTextStyle(context, wght: 600));

Expand Down Expand Up @@ -775,9 +775,9 @@ class DmRecipientHeader extends StatelessWidget {
child: Icon(size: 16, ZulipIcons.user)),
Expanded(
child: Text(title,
style: const TextStyle(
style: TextStyle(
fontSize: 16,
letterSpacing: 0.02 * 16,
letterSpacing: proportionalLetterSpacing(context, 0.02, baseFontSize: 16),
height: (18 / 16),
).merge(weightVariableTextStyle(context, wght: 600)),
overflow: TextOverflow.ellipsis)),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/subscription_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _SubscriptionListHeader extends StatelessWidget {
style: TextStyle(
color: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.5).toColor(),
fontSize: 14,
letterSpacing: 0.04 * 14,
letterSpacing: proportionalLetterSpacing(context, 0.04, baseFontSize: 14),
height: (16 / 14),
))),
const SizedBox(width: 8),
Expand Down

0 comments on commit a500b0b

Please sign in to comment.