Merge pull request #6478 from PySimpleGUI/Dev-latest

Fixed bug in Button.update.  Corrected when activeforeground and acti…
This commit is contained in:
PySimpleGUI 2023-08-14 12:22:29 -04:00 committed by GitHub
commit 81638809c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.61.0.191 Unreleased" version = __version__ = "4.61.0.192 Unreleased"
_change_log = """ _change_log = """
Changelog since 4.60.0 released to PyPI on 8-May-2022 Changelog since 4.60.0 released to PyPI on 8-May-2022
@ -454,6 +454,8 @@ _change_log = """
Fix typo of text in _widget_was_created Fix typo of text in _widget_was_created
4.61.0.191 4.61.0.191
Fixed bug in Button.update. Was setting the activeforeground and activebackground which broke the mouseover or mouse press colors Fixed bug in Button.update. Was setting the activeforeground and activebackground which broke the mouseover or mouse press colors
4.61.0.192
Fixed bug in Button.update. Corrected when activeforeground and activebackground are set. Removing them in version above was a mistake
""" """
@ -5576,11 +5578,9 @@ class Button(Element):
button_style.configure(style_name, background=bc[1]) button_style.configure(style_name, background=bc[1])
else: else:
if bc[0] not in (None, COLOR_SYSTEM_DEFAULT): if bc[0] not in (None, COLOR_SYSTEM_DEFAULT):
# self.TKButton.config(foreground=bc[0], activeforeground=bc[0]) # Removed 13-Aug-2023. Was causing mouseover to not work self.TKButton.config(foreground=bc[0], activebackground=bc[0])
self.TKButton.config(foreground=bc[0])
if bc[1] not in (None, COLOR_SYSTEM_DEFAULT): if bc[1] not in (None, COLOR_SYSTEM_DEFAULT):
# self.TKButton.config(background=bc[1], activebackground=bc[1]) # Removed 13-Aug-2023. Was causing mouseover to not work self.TKButton.config(background=bc[1], activeforeground=bc[1])
self.TKButton.config(background=bc[1])
self.ButtonColor = bc self.ButtonColor = bc
if disabled is True: if disabled is True:
self.TKButton['state'] = 'disabled' self.TKButton['state'] = 'disabled'