-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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:
New: