8000 Merge pull request #22174 from daniilS/tk_toolbar_buttons · matplotlib/matplotlib@f393802 · GitHub
[go: up one dir, main page]

Skip to content

Commit f393802

Browse files
authored
Merge pull request #22174 from daniilS/tk_toolbar_buttons
Give the Tk toolbar buttons a flat look
2 parents 0406c46 + 5555daa commit f393802

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,10 @@ def _set_image_for_button(self, button):
660660

661661
def _Button(self, text, image_file, toggle, command):
662662
if not toggle:
663-
b = tk.Button(master=self, text=text, command=command)
663+
b = tk.Button(
664+
master=self, text=text, command=command,
665+
relief="flat", overrelief="groove", borderwidth=1,
666+
)
664667
else:
665668
# There is a bug in tkinter included in some python 3.6 versions
666669
# that without this variable, produces a "visual" toggling of
@@ -669,8 +672,10 @@ def _Button(self, text, image_file, toggle, command):
669672
# https://bugs.python.org/issue25684
670673
var = tk.IntVar(master=self)
671674
b = tk.Checkbutton(
672-
master=self, text=text, command=command,
673-
indicatoron=False, variable=var)
675+
master=self, text=text, command=command, indicatoron=False,
676+
variable=var, offrelief="flat", overrelief="groove",
677+
borderwidth=1
678+
)
674679
b.var = var
675680
b._image_file = image_file
676681
if image_file is not None:

0 commit comments

Comments
 (0)
0