From b60859dfd6ca2301afd0494a8f561ae4bb021252 Mon Sep 17 00:00:00 2001 From: Tom Schimansky Date: Mon, 24 Apr 2023 13:45:16 +0200 Subject: [PATCH] added text color configuration for switch #1497 --- customtkinter/windows/widgets/ctk_switch.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/customtkinter/windows/widgets/ctk_switch.py b/customtkinter/windows/widgets/ctk_switch.py index 2f807e6..7945f63 100644 --- a/customtkinter/windows/widgets/ctk_switch.py +++ b/customtkinter/windows/widgets/ctk_switch.py @@ -299,6 +299,10 @@ class CTkSwitch(CTkBaseClass): self._fg_color = self._check_color_type(kwargs.pop("fg_color")) require_redraw = True + if "border_color" in kwargs: + self._border_color = self._check_color_type(kwargs.pop("border_color"), transparency=True) + require_redraw = True + if "progress_color" in kwargs: self._progress_color = self._check_color_type(kwargs.pop("progress_color"), transparency=True) require_redraw = True @@ -311,8 +315,12 @@ class CTkSwitch(CTkBaseClass): self._button_hover_color = self._check_color_type(kwargs.pop("button_hover_color")) require_redraw = True - if "border_color" in kwargs: - self._border_color = self._check_color_type(kwargs.pop("border_color"), transparency=True) + if "text_color" in kwargs: + self._text_color = self._check_color_type(kwargs.pop("text_color")) + require_redraw = True + + if "text_color_disabled" in kwargs: + self._text_color_disabled = self._check_color_type(kwargs.pop("text_color_disabled")) require_redraw = True if "hover" in kwargs: