Skip to content

Commit

Permalink
TTK Button wraplen and padding height changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PySimpleGUI committed Dec 15, 2021
1 parent 800e1c8 commit 9022fd2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions PySimpleGUI.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/python3
version = __version__ = "4.55.1.17 Unreleased"
version = __version__ = "4.55.1.18 Unreleased"

_change_log = """
Changelog since 4.55.1 released to PyPI on 7-Nov-2021
Expand Down Expand Up @@ -54,6 +54,8 @@
Fix in open github issue - the python experience and overall experience values were swapped.
4.55.1.17
UserSettings - delete_entry will show popup error now with traceback like almost all PySimpleGUI errors (can be silenced)
4.55.1.18
TTK Button - wraplen fix, height padding fix? (thank you Jason for another fix!)
"""

__version__ = version.split()[0] # For PEP 396 and PEP 345
Expand Down Expand Up @@ -14255,9 +14257,9 @@ def _add_expansion(element, row_should_expand, row_fill_direction):
button_style.map(style_name, background=[('disabled', element.DisabledButtonColor[1])])

if height > 1:
button_style.configure(style_name, padding=height * _char_width_in_pixels(font)) # should this be height instead?
wraplen = tkbutton.winfo_reqwidth() # width of widget in Pixels
button_style.configure(style_name, padding=height * _char_height_in_pixels(font)) # should this be height instead?
if width != 0:
wraplen = width * _char_width_in_pixels(font) # width of widget in Pixels
button_style.configure(style_name, wraplength=wraplen) # set wrap to width of widget

## -------------- TTK Button With Image -------------- ##
Expand Down

0 comments on commit 9022fd2

Please sign in to comment.