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

Overhaul the theme editor and improve user experience #49388

Merged

Conversation

YuriSizov
Copy link
Contributor

@YuriSizov YuriSizov commented Jun 7, 2021

Closes godotengine/godot-proposals#2505.

Most of what is described in the proposal is implemented (it was mostly already implemented back then even 🙃). I've decided to exclude a preview builder tool from this. I think if we were to design such a tool for Godot it needs to be a universally useful tool, for creating UIs in general, not just previews in the theme editor. And to that end, it can also be a plugin.

Changes here are not cherry-pickable to 3.x. For my previous related PRs I've already released dedicated commits that backport the changes which are backportable. I will create a dedicated PR for this one as well when it is approved.

Here are a couple of screenshots of this thing in editor with the latest editor theme:

godot windows tools 64_2021-06-07_15-33-17

godot windows tools 64_2021-06-07_15-34-24

godot windows tools 64_2021-06-07_15-36-41

@YuriSizov YuriSizov force-pushed the theme-editor-better-previews branch from 361f3c3 to 10fc4d8 Compare June 8, 2021 10:11
@KoBeWi
Copy link
Member

KoBeWi commented Jun 8, 2021

The preview background confused me. I made a simple scene with Control root and single panel and when used as preview, the panel was stretched over the whole preview. It turned out that the preview uses panel style as default background. It should use default clear color IMO. Or at least use the panel from editor not from the edited theme.

@YuriSizov
Copy link
Contributor Author

YuriSizov commented Jun 8, 2021

The preview background confused me. I made a simple scene with Control root and single panel and when used as preview, the panel was stretched over the whole preview. It turned out that the preview uses panel style as default background. It should use default clear color IMO. Or at least use the panel from editor not from the edited theme.

I don't think I've changed it in that regard from what it is now, but I agree that it can be confusing. With the clear color you mean the same we use for 2d scenes in previews?

@KoBeWi
Copy link
Member

KoBeWi commented Jun 8, 2021

With the clear color you mean the same we use for 2d scenes in previews?

Yes, the default background in 2D editor.

@YuriSizov YuriSizov force-pushed the theme-editor-better-previews branch from 10fc4d8 to b3f543d Compare June 9, 2021 14:12
@YuriSizov
Copy link
Contributor Author

Yeah, okay, made it use the previews have a default clear color as a background. This led me to add a panel to the default preview anyway, just so it looks nicer as a component zoo. Similarly, custom previews would need to add some sort of background as well, if it is desired. Content of the preview is still padded for better usability with single-component scenes (if, for example, your scene is just a button), so a clear-colored fringe is going to be present in all previews.

I've also made the minimal size for the previews much smaller. Here are some pictures:

Default preview
Custom scene w/ a panel
Custom scene w/o a panel
Custom button
Custom clear color

@KoBeWi
Copy link
Member

KoBeWi commented Jun 9, 2021

For some reason when you delete a preview scene and try to reload it, nothing happens. I'd expect some error at least. Same when the scene is renamed. Seems like PackedScene is being cached and remains after file was removed.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 9, 2021

I think the type panel should have some bigger minimum height. It looks bad when you open it for the first time and there is a list of elements:
image

@YuriSizov YuriSizov force-pushed the theme-editor-better-previews branch from b3f543d to 688f00c Compare June 10, 2021 10:59
@YuriSizov
Copy link
Contributor Author

I think the type panel should have some bigger minimum height.

Done, now the minimal height is about 4 items big.

For some reason when you delete a preview scene and try to reload it, nothing happens. I'd expect some error at least. Same when the scene is renamed. Seems like PackedScene is being cached and remains after file was removed.

Renames are actually fine, the reference I use correctly updates its path. And for removes it correctly clears the path. So I've added a check for an empty path and for the file existence for good measure. Invalid scene is immediately removed as preview, same as it already does when you change its root from a Control node to something else.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 10, 2021

Renames are actually fine, the reference I use correctly updates its path.

Maybe it could update the tab name too.

@YuriSizov YuriSizov force-pushed the theme-editor-better-previews branch from 688f00c to ff37c8b Compare June 10, 2021 11:50
@YuriSizov
Copy link
Contributor Author

Maybe it could update the tab name too.

Yes, good call. Done.

@YuriSizov YuriSizov force-pushed the theme-editor-better-previews branch 2 times, most recently from 0a5e175 to 753a9b8 Compare June 10, 2021 20:41
@YuriSizov YuriSizov force-pushed the theme-editor-better-previews branch from 753a9b8 to d0e86c7 Compare June 14, 2021 18:49
@akien-mga akien-mga merged commit 4e582f9 into godotengine:master Jun 14, 2021
@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.

Improved Theme Editor
3 participants