Skip to content

Commit cfc5dc2

Browse files
authored
Increase Tooltip font size on Desktop (#103189)
1 parent e571835 commit cfc5dc2

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

packages/flutter/lib/src/material/tooltip.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
406406
case TargetPlatform.macOS:
407407
case TargetPlatform.linux:
408408
case TargetPlatform.windows:
409-
return 10.0;
409+
return 12.0;
410410
case TargetPlatform.android:
411411
case TargetPlatform.fuchsia:
412412
case TargetPlatform.iOS:

packages/flutter/test/material/tooltip_test.dart

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,7 @@ void main() {
700700
return Tooltip(
701701
key: tooltipKey,
702702
message: tooltipText,
703-
child: const SizedBox(
704-
width: 0.0,
705-
height: 0.0,
706-
),
703+
child: const SizedBox.shrink(),
707704
);
708705
},
709706
),
@@ -733,26 +730,22 @@ void main() {
733730
home: Tooltip(
734731
key: tooltipKey,
735732
message: tooltipText,
736-
child: const SizedBox(
737-
width: 0.0,
738-
height: 0.0,
739-
),
733+
child: const SizedBox.shrink(),
740734
),
741735
),
742736
);
743737
tooltipKey.currentState?.ensureTooltipVisible();
744738
await tester.pump(const Duration(seconds: 2)); // faded in, show timer started (and at 0.0)
745739

746740
final RenderParagraph tooltipRenderParagraph = tester.renderObject<RenderParagraph>(find.text(tooltipText));
747-
expect(tooltipRenderParagraph.textSize.height, equals(10.0));
741+
expect(tooltipRenderParagraph.textSize.height, equals(12.0));
748742

749-
final RenderBox tip = tester.renderObject(
743+
final RenderBox tooltipContainer = tester.renderObject(
750744
_findTooltipContainer(tooltipText),
751745
);
752-
expect(tip.size.height, equals(24.0));
753-
expect(tip.size.width, equals(46.0));
754-
expect(tip, paints..rrect(
755-
rrect: RRect.fromRectAndRadius(tip.paintBounds, const Radius.circular(4.0)),
746+
expect(tooltipContainer.size.height, equals(24.0));
747+
expect(tooltipContainer, paints..rrect(
748+
rrect: RRect.fromRectAndRadius(tooltipContainer.paintBounds, const Radius.circular(4.0)),
756749
color: const Color(0xe6616161),
757750
));
758751
}, variant: const TargetPlatformVariant(<TargetPlatform>{TargetPlatform.macOS, TargetPlatform.linux, TargetPlatform.windows}));

0 commit comments

Comments
 (0)