Skip to content

Give the Tk toolbar buttons a flat look #22174

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

Conversation

daniilS
Copy link
Contributor

@daniilS daniilS commented Jan 9, 2022

PR Summary

This changes the parameters of the buttons in the Tk navigation toolbar to give them a flat look (with an outline showing when the mouse is over the button), similar to the Qt backend. For comparison:
Old:
old
New:
new

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.

I think this looks nicer and more modern.

b = tk.Button(master=self, text=text, command=command)
b = tk.Button(
master=self, text=text, command=command,
relief="flat", overrelief="groove", borderwidth=1,
Copy link
Member

Choose a reason for hiding this comment

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

Is the border width inside or outside the button? Just wondering if the size we allocate is consistent on HiDPI screens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's outside of the button, and the default width seems to be 2, so space shouldn't be an issue.

Copy link
Member

Choose a reason for hiding this comment

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

I'm more concerned about the height of the toolbar than the width of the border itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The toolbar height is set to the height of two text lines here, which on all platforms I've tried is bigger than the size of the buttons, so the buttons becoming 2px smaller shouldn't affect the height of the toolbar.

@QuLogic QuLogic merged commit f393802 into matplotlib:main Jan 21, 2022
@daniilS daniilS deleted the tk_toolbar_buttons branch January 21, 2022 14:49
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