Update ctk_button.py

fixed the display of text on the opposite (when hovering over it) button module. That is, when you hover over the button, if the colors are bright, then the text merges with the background, this behavior was added in the `_on_enter` and `_on_leave` functions, respectively
This commit is contained in:
hk2281
2022-12-08 16:45:05 +02:00
committed by GitHub
parent 61adb1da07
commit 952259b215

View File

@ -488,7 +488,8 @@ class CTkButton(CTkBaseClass):
# set text_label bg color to button hover color # set text_label bg color to button hover color
if self._text_label is not None: if self._text_label is not None:
self._text_label.configure(bg=self._apply_appearance_mode(inner_parts_color)) self._text_label.configure(bg=self._apply_appearance_mode(inner_parts_color),
fg=self._apply_appearance_mode(self._fg_color))
# set image_label bg color to button hover color # set image_label bg color to button hover color
if self._image_label is not None: if self._image_label is not None:
@ -509,7 +510,8 @@ class CTkButton(CTkBaseClass):
# set text_label bg color (label color) # set text_label bg color (label color)
if self._text_label is not None: if self._text_label is not None:
self._text_label.configure(bg=self._apply_appearance_mode(inner_parts_color)) self._text_label.configure(bg=self._apply_appearance_mode(inner_parts_color),
fg=self._apply_appearance_mode(self._text_color))
# set image_label bg color (image bg color) # set image_label bg color (image bg color)
if self._image_label is not None: if self._image_label is not None: