From 9f33f13e1b80f5ef1f06138e0c0ff40c31048905 Mon Sep 17 00:00:00 2001 From: Yahia <38565928+Yivi64@users.noreply.github.com> Date: Thu, 2 Mar 2023 02:36:30 +0400 Subject: [PATCH] Fix Frame inside ScrollableFrame Frames inside ScrollableFrames did not get a new top level fg_color and remained the same color as the parent. Implemented a fix by checking if the parent of a Frame is a ScrollableFrame and changing the fg_color to be like any Frame inside another Frame --- customtkinter/windows/widgets/ctk_frame.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/customtkinter/windows/widgets/ctk_frame.py b/customtkinter/windows/widgets/ctk_frame.py index 67bf1615..51182542 100644 --- a/customtkinter/windows/widgets/ctk_frame.py +++ b/customtkinter/windows/widgets/ctk_frame.py @@ -4,6 +4,7 @@ from .theme import ThemeManager from .core_rendering import DrawEngine from .core_widget_classes import CTkBaseClass +import customtkinter.windows.widgets as widgets class CTkFrame(CTkBaseClass): @@ -44,6 +45,8 @@ def __init__(self, self._fg_color = ThemeManager.theme["CTkFrame"]["fg_color"] else: self._fg_color = ThemeManager.theme["CTkFrame"]["fg_color"] + if isinstance(self.master, widgets.ctk_scrollable_frame.CTkScrollableFrame): + self._fg_color = ThemeManager.theme["CTkFrame"]["top_fg_color"] else: self._fg_color = self._check_color_type(fg_color, transparency=True)