Skip to content

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Apr 24, 2019

Description

Adds support for mouse pointer hovering to trigger tooltips, as well as custom timeouts for the tooltip durations, and a custom decoration. It also makes the tooltip be fully opaque when shown, and fade in over 150ms, and fade out over 75ms, and draw a 4.0 corner radius, all to conform with the material spec. Prior to this change, it was using a corner radius of 2.0 when shown, and faded in and out over 200ms.

Related Issues

Fixes #22817

Tests

I added the following tests:

  • Test to see if tooltip appears on hover
  • Test to see if tooltip remains as long as pointer is over widget
  • Test to see if tooltip disappears after being displayed for 1.5 seconds.
  • Test to see if tooltip is drawn with the right shape and color by default.
  • Test to see if tooltip honors custom decoration.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@gspencergoog gspencergoog changed the title Tooltip hover Add support for Tooltip hover Apr 24, 2019
Copy link
Contributor

@efortuna efortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Greg!!

@gspencergoog gspencergoog force-pushed the tooltip_hover branch 3 times, most recently from ba98f36 to 29ed6b6 Compare April 25, 2019 02:02
Copy link
Contributor

@darrenaustin darrenaustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog merged commit eca9364 into flutter:master Apr 25, 2019
gspencergoog added a commit to gspencergoog/flutter that referenced this pull request Apr 26, 2019
This reverts commit eca9364 because of four
performance regressions. Will fix and re-land.
gspencergoog added a commit that referenced this pull request Apr 26, 2019
This reverts commit eca9364 because of four
performance regressions. Will fix and re-land.
gspencergoog added a commit to gspencergoog/flutter that referenced this pull request May 1, 2019
This is a re-land of flutter#31561, after fixing performance regressions.
gspencergoog added a commit that referenced this pull request May 3, 2019
This is a re-land of #31561, after fixing performance regressions.

Added change listening to the MouseTracker so that the Listener and tooltip can react to whether or not a mouse is connected at all. Added a change check to make sure Listener only repaints when something changed.

Fixes #22817
@gspencergoog gspencergoog deleted the tooltip_hover branch May 15, 2019 16:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for showing tooltip on mouse hover

4 participants