Skip to content

Comments

Fix Frame fg_color inside ScrollableFrame#1298

Open
Yivi64 wants to merge 1 commit intoTomSchimansky:masterfrom
Yivi64:master
Open

Fix Frame fg_color inside ScrollableFrame#1298
Yivi64 wants to merge 1 commit intoTomSchimansky:masterfrom
Yivi64:master

Conversation

@Yivi64
Copy link

@Yivi64 Yivi64 commented Mar 1, 2023

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.

See here for the before:
beforectk

And After:
afterctk

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
@FedericoSpada
Copy link
Collaborator

Hi,
I don't like your solution: the problem is not due to how you wrote it, but the fact that the existing code made you write it like that (for example, you can't import CTkScrollableFrame directly because it would create a recursive import condition).
I think we should work to change CTkScrollableFrame to inherit directly from CTkFrame instead of tkinter.Frame.
In that case, the initial check if isinstance(self.master, CTkFrame) would also be true for CTkScrollableFrame. Moreover, we would also get the same effect if a CTkScrollableFrame is placed inside another CTkScrollableFrame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants