From 952259b215ea53392b46e52777d959c5db2c92e4 Mon Sep 17 00:00:00 2001 From: hk2281 Date: Thu, 8 Dec 2022 16:45:05 +0200 Subject: [PATCH] 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 --- customtkinter/windows/widgets/ctk_button.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/customtkinter/windows/widgets/ctk_button.py b/customtkinter/windows/widgets/ctk_button.py index 5b5b8f0..a04885a 100644 --- a/customtkinter/windows/widgets/ctk_button.py +++ b/customtkinter/windows/widgets/ctk_button.py @@ -488,7 +488,8 @@ class CTkButton(CTkBaseClass): # set text_label bg color to button hover color 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 if self._image_label is not None: @@ -509,7 +510,8 @@ class CTkButton(CTkBaseClass): # set text_label bg color (label color) 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) if self._image_label is not None: