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
This commit is contained in:
Yahia 2023-03-02 02:36:30 +04:00 committed by GitHub
parent 09e584634c
commit 9f33f13e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ from .core_rendering import CTkCanvas
from .theme import ThemeManager from .theme import ThemeManager
from .core_rendering import DrawEngine from .core_rendering import DrawEngine
from .core_widget_classes import CTkBaseClass from .core_widget_classes import CTkBaseClass
import customtkinter.windows.widgets as widgets
class CTkFrame(CTkBaseClass): class CTkFrame(CTkBaseClass):
@ -44,6 +45,8 @@ class CTkFrame(CTkBaseClass):
self._fg_color = ThemeManager.theme["CTkFrame"]["fg_color"] self._fg_color = ThemeManager.theme["CTkFrame"]["fg_color"]
else: else:
self._fg_color = ThemeManager.theme["CTkFrame"]["fg_color"] 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: else:
self._fg_color = self._check_color_type(fg_color, transparency=True) self._fg_color = self._check_color_type(fg_color, transparency=True)