Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dumb and manual theme caching systems to Window #65192

Merged

Conversation

YuriSizov
Copy link
Contributor

@YuriSizov YuriSizov commented Sep 1, 2022

A continuation of #65156, but for Window and its derivatives this time. I've also added the dumb caching system previously introduced for controls in #64314, because that's only reasonable.

In relation to windows there is one thing that I didn't touch here, but that needs some rework later on. When a Viewport is handling its subwindows, all drawing code is in the Viewport class, which makes it very inconvenient to introduce the cache, and it also moves responsibilities to outside of Window, and spreads the string usage beyond where we can control it. Juan wasn't against me reworking this bit to organize the code a bit better and encapsulate some of the Viewport::_sub_window_* methods' logic inside of Window. But I'll look into it at a later date.

I also want to bring back WindowDialog removed during the multiwindow/viewport refactoring. Currently the base "dialog" node is AcceptDialog, which has extra stuff like buttons. IMO a more basic class is needed, and since we used to have it in WindowDialog, it's sensible to me to bring it back. This should also clean up the styles for dialogs, as currently all the base styles are defined in AcceptDialog (and before this PR there was a mystical Dialogs theme type which was manually polled for items, instead of using inheritance like we do elsewhere).

Other than that, this is a straightforward version of #65156 for Windows. It's also independent, so if the general concept is approved and the code is good it can be merged before the other one.

@akien-mga akien-mga merged commit 8c7be63 into godotengine:master Sep 1, 2022
@akien-mga
Copy link
Member

Thanks!

@YuriSizov YuriSizov deleted the control-customizable-cache-p2 branch September 1, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants