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

Copy local theme overrides from Control to Window #69353

Merged

Conversation

YuriSizov
Copy link
Contributor

@YuriSizov YuriSizov commented Nov 29, 2022

Closes #69308. This is probably the last missing feature from Windows related to theming.

While this PR manipulates a lot of lines, it doesn't do anything particularly smart. Most of the code is just copied and adapted from control.h/cpp. I've renamed some internal members in Control as well, for consistency. And moved some things in Window for better grouping. Documentation should also be in sync now.

godot.windows.editor.dev.x86_64_2022-11-29_22-57-09.mp4

PS. My plan is to reduce this duplicated code significantly in future, when I can work on the first-class theme properties. But for now this will do.

@YuriSizov YuriSizov added this to the 4.0 milestone Nov 29, 2022
@YuriSizov YuriSizov requested review from a team as code owners November 29, 2022 20:05
@YuriSizov YuriSizov force-pushed the window-be-more-like-your-brother branch from 025e6e0 to e551c97 Compare November 29, 2022 20:59
@YuriSizov YuriSizov requested a review from a team as a code owner November 29, 2022 20:59
@akien-mga akien-mga requested a review from bruvzg December 5, 2022 14:11
@KoBeWi
Copy link
Member

KoBeWi commented Dec 7, 2022

Changing overrides does not update the window immediately.
godot windows editor dev x86_64_39dA6tyjyF

@YuriSizov
Copy link
Contributor Author

Changing overrides does not update the window immediately.

Hmm, it clearly works with popups. Can it be an issue with the editor preview viewport?

@KoBeWi
Copy link
Member

KoBeWi commented Dec 7, 2022

Seems like the window does not redraw on theme change. Changing size will refresh the style.

@YuriSizov YuriSizov force-pushed the window-be-more-like-your-brother branch from e551c97 to 29cc86f Compare December 7, 2022 17:51
@YuriSizov
Copy link
Contributor Author

YuriSizov commented Dec 7, 2022

There doesn't seem to be a dedicated method to update a window like there is for CanvasItems (queue_redraw), but we can consider that theme changes can cause window size changes and thus request that kind of update. I've hooked into an existing method that already does that for when new child nodes are added, because this call needs to be deferred otherwise we face a lot of lag.

godot.windows.editor.dev.x86_64_2022-12-07_20-49-32.mp4

@akien-mga akien-mga merged commit 597e0c0 into godotengine:master Dec 9, 2022
@akien-mga
Copy link
Member

Thanks!

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.

StyleBox texture for PopupPanel missing
3 participants