Skip to content

Make Tk windows use the same icon as other backends #22145

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 7, 2022

Conversation

daniilS
Copy link
Contributor

@daniilS daniilS commented Jan 7, 2022

PR Summary

This makes the icons look better, and consistent with the other backends. See below for examples on Windows. The only icon that doesn't quite look right is the titlebar icon at 100% scaling. If a 16x16 image is supplied, Windows will preferentially use that, which looks better, but then it will also use it at other scaling factors, making them blurry. I think this is the best the icons can look with the current version of Tk.

Old New
100_icon_old 100_icon_new
100_taskbar_old 100_taskbar_new
150_icon_old 150_icon_new
150_taskbar_old 150_taskbar_new

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (and pytest passes).
  • [N/A] 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).

@tacaswell tacaswell added this to the v3.6.0 milestone Jan 7, 2022
@tacaswell
Copy link
Member

It looks like we switch from a gif to a ppm in 2015. Is the important change here going from ppm -> png or just that the png icon is higher resolution (and has alpha)?

@daniilS
Copy link
Contributor Author

daniilS commented Jan 7, 2022

@tacaswell The change is going from ppm to png, as all the other backends use the auto-generated png icons, but Tk had its own file that looks different. I reckon it's best to minimise backend differences, same logic as #18889. Alpha channel support is also an advantage.

@tacaswell
Copy link
Member

Sorry, my last comment was very confusing 🐑

I think the real improvement here is to use a better icon (which matches the rest of the backends). The fact that the old one was ppm and the new one is png is not really relevant (as if they were called v0.png and v1.png and we had the before / after above we would still want to do this)?

Or is there something about ppm files (that I do not know/understand) that makes the png version of the icon better?

@daniilS
Copy link
Contributor Author

daniilS commented Jan 7, 2022

Ah right, I get you. Yes, the change is going from v0 to v1, the change to png is just because that's how the v1 icon is stored and there's no need for the unique ppm file any more now that PIL is a dependency. I'll change the title.

@daniilS daniilS changed the title Use PNG rather than PPM image for Tk iconphotos Make Tk windows use the same icon as other backends Jan 7, 2022
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

I've been meaning to do this since I noticed it.

@QuLogic QuLogic merged commit 8366ea4 into matplotlib:main Jan 7, 2022
@QuLogic QuLogic added the GUI: tk label Jan 7, 2022
@QuLogic
Copy link
Member

QuLogic commented Jan 7, 2022

Thanks @daniilS! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

@daniilS
Copy link
Contributor Author

daniilS commented Jan 7, 2022

Thanks @QuLogic! I thought the Tk backend could use some love so have been going through all the open "GUI/tk" issues one by one 😅

@daniilS daniilS deleted the tk_iconphoto branch January 8, 2022 01:26
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.

3 participants