Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prevent tooltips from overlapping buttons in NavigationToolbar2Tk (fixes issue mentioned in #22028) #22078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

daniilS
Copy link
Contributor

@daniilS daniilS commented Jan 2, 2022

PR Summary

As mentioned in the comments of #22028, the tooltips for the navigation toolbar buttons in the Tk backend overlap the right side of the buttons (probably DPI/resolution dependent), as the x-offset is hardcoded. This makes the right half of the buttons unresponsive, as the tooltip is continuously being shown and hidden. This PR always makes the tooltip appear directly to the right of its button.

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).

@QuLogic QuLogic added the status: needs workflow approval For PRs from new contributors, from which GitHub blocks workflows by default. label Jan 6, 2022
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

The change itself is fine.

Please do not merge the main branch into a PR. As far as I understand git that will cause problems when we backport this for 3.5.2, which would be the natural thing to do for this bugfix. If you need to take changes from main into account in your branch here, please rebase on main.

@daniilS daniilS force-pushed the tk_toolbar_tooltips branch from 67b504d to 5b4701a Compare January 6, 2022 23:49
@daniilS
Copy link
Contributor Author

daniilS commented Jan 6, 2022

@timhoffm thanks, I've changed the merge into a rebase now. I'll do that for #22077 as well.

@QuLogic
Copy link
Member

QuLogic commented Jan 6, 2022

Please do not merge the main branch into a PR. As far as I understand git that will cause problems when we backport this for 3.5.2, which would be the natural thing to do for this bugfix. If you need to take changes from main into account in your branch here, please rebase on main.

This is not technically true. The backport uses the merge commit vs the previous main HEAD, and doesn't care about the commits within the PR. We could also have squash merged the PR, which would ignore all the commits as well.

However, we do prefer rebases over merges, especially for small singular commit PRs like this one.

@daniilS daniilS force-pushed the tk_toolbar_tooltips branch from 5b4701a to 6629ce6 Compare January 7, 2022 01:02
@daniilS daniilS requested a review from timhoffm January 7, 2022 23:48
@daniilS
Copy link
Contributor Author

daniilS commented Jan 7, 2022

The failing test looks unrelated to the change

@timhoffm
Copy link
Member

timhoffm commented Jan 8, 2022

codecov sometimes does strange things. TBH I don't understand it either.

@QuLogic QuLogic added this to the v3.5.2 milestone Jan 8, 2022
@QuLogic QuLogic removed the status: needs workflow approval For PRs from new contributors, from which GitHub blocks workflows by default. label Jan 8, 2022
@QuLogic QuLogic merged commit dfd8591 into matplotlib:main Jan 8, 2022
@QuLogic
Copy link
Member

QuLogic commented Jan 8, 2022

I restarted the failing test, it isn't failing any more; codecov is correct, we don't test tooltips.

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 8, 2022
…ns in NavigationToolbar2Tk (fixes issue mentioned in matplotlib#22028)
@daniilS daniilS deleted the tk_toolbar_tooltips branch January 8, 2022 01:28
QuLogic added a commit that referenced this pull request Jan 8, 2022
…078-on-v3.5.x

Backport PR #22078 on branch v3.5.x (Prevent tooltips from overlapping buttons in NavigationToolbar2Tk (fixes issue mentioned in #22028))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants