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 max width to entity icons in tree #165

Merged
merged 9 commits into from
Jun 18, 2024

Conversation

andersmmg
Copy link
Contributor

@andersmmg andersmmg commented Jan 13, 2024

Description

Sets max width of tree item icons for entities in tree. This allows using larger scale svg icons without having to scale them just to use them in Pandora.

Addressed issues

@andersmmg andersmmg marked this pull request as ready for review January 13, 2024 22:01
@andersmmg
Copy link
Contributor Author

andersmmg commented Jan 13, 2024

This basically fixes it, but probably needs work for editor scaling

@andersmmg andersmmg marked this pull request as draft January 13, 2024 22:06
@andersmmg andersmmg marked this pull request as ready for review January 13, 2024 22:07
@andersmmg
Copy link
Contributor Author

Okay, this actually seems to work. Just multiplies the editor scale by 16 to calculate the icon scale. Tested with 75% scale and 125%

@bitbrain
Copy link
Owner

bitbrain commented Jan 13, 2024

@andersmmg unfortunately, EditorInterface needs to be passed through manually, as it would break compatibility otherwise with Godot 4.1 and 4.0 (see failures)

Copy link
Owner

@bitbrain bitbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass through EditorInterface manually to remain backwards-compatible.

@bitbrain
Copy link
Owner

@andersmmg any update on this?

@andersmmg
Copy link
Contributor Author

Sorry, haven't been working on this kind of stuff in a while. I think this should at least fix it to be more backwards compatible?

@bitbrain
Copy link
Owner

bitbrain commented Jun 8, 2024

Seems to fail still:

ERROR: The object does not have any 'meta' values with the key 'PandoraEditorPlugin'.
   at: get_meta (core/object/object.cpp:924)

See: https://github.com/bitbrain/pandora/actions/runs/9361941184/job/25974226743?pr=165

@andersmmg
Copy link
Contributor Author

That's odd, it works on my end. The meta value is set in "_enter_tree" of the plugin, so I'm not sure why a part of the plugin thinks it's not set. It's also odd that the issue doesn't show up until partway through the unit tests, I couldn't find anything specific about why it would fail when running the test_create_reference_array test specifically

@andersmmg
Copy link
Contributor Author

This may work, and hopefully will pass the unit tests. I've been unable to run the tests locally, gdunit won't work for me

@bitbrain
Copy link
Owner

Hey, thanks for this!

@bitbrain bitbrain merged commit 4827489 into bitbrain:godot-4.x Jun 18, 2024
4 checks passed
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.

Icons Don't scale
2 participants