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

Fix Sprite2D dialog size for smaller screen device #97199

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

shahriarlabib000
Copy link
Contributor

@shahriarlabib000 shahriarlabib000 commented Sep 19, 2024

So my editor scale was 180% by default

Before

Screenshot_2024-09-20-01-27-09-532_org godotengine editor v4

Now

Screenshot_2024-09-20-01-24-26-426_org godotengine editor v4 debug

@shahriarlabib000 shahriarlabib000 requested a review from a team as a code owner September 19, 2024 19:36
@WhalesState
Copy link
Contributor

WhalesState commented Sep 19, 2024

I feel like we should change window size instead of the Control's minimum size, and we leave the minimum size to be calculated automatically, to avoid such limitation.

Since if you scale the UI by 200%, you will need to make another fix to fit your screen.

@shahriarlabib000
Copy link
Contributor Author

I have no idea how to do that. Could you pls review and suggest the change pls

@shahriarlabib000
Copy link
Contributor Author

The easiest solution would be to set the minimum size height even lower 😅 (im joking)

@shahriarlabib000
Copy link
Contributor Author

shahriarlabib000 commented Sep 20, 2024

This went horribly

https://github.com/shahriarlabib000/godot/blob/3b60ec132b4cf9872b69b91a52fa2cebf2644894/editor/plugins/sprite_2d_editor_plugin.cpp#L601-#L602

	debug_uv->set_size(Size2(800, 400) * EDSCALE);
//	debug_uv->set_custom_minimum_size(Size2(800, 500) * EDSCALE);

Screenshot_2024-09-20-18-05-17-190_org godotengine editor v4 debug

@WhalesState
Copy link
Contributor

Yes, it's because the Window.popup() was called without setting the window size, everything will shrink to it's minimum size, if you need some help, just search Sprite2DEditorPlugin and there's a popup call for the Window we need to set the Window size there. not in the same file, because i think it's using the WindowWrapper class.

@shahriarlabib000
Copy link
Contributor Author

shahriarlabib000 commented Sep 20, 2024

This one?

debug_uv_dialog->popup_centered();

Tried something like this before. Didn't quite work. Maybe I'll try again
shahriarlabib000@f66ad84

@WhalesState
Copy link
Contributor

WhalesState commented Sep 20, 2024

oh, I was searching for popup as a full word before.

Try this and see if you can freely resize the window, it should remember it's last size everytime popup is called.

image

If the VBoxContainer vp didn't expand we may consider using wrap_controls for the Dialog and set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT) for the VBoxContainer, but I think it should expand correctly.

@shahriarlabib000
Copy link
Contributor Author

Did that in shahriarlabib000@9b82214 right now. Works fine for most part But the popup looks too small at 100%

4.3

Screenshot_2024-09-21-00-40-11-847_org godotengine editor v4

now

Screenshot_2024-09-21-00-41-12-092_org godotengine editor v4 debug

@WhalesState
Copy link
Contributor

Works fine for most part But the popup looks too small at 100%

Before it was setting just the control minimum size, so the other Control nodes also provided their minimum size to be added to the Window minimum size.

image

Now we are setting the whole window size, so maybe we can increase the Window size a bit. 960 x 540 is fine, which will become 1920x1080 when the editor scale is x2.

@shahriarlabib000
Copy link
Contributor Author

shahriarlabib000 commented Sep 20, 2024

I think following this

If the VBoxContainer vp didn't expand we may consider using wrap_controls for the Dialog and set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT) for the VBoxContainer, but I think it should expand correctly.

Also gives a similar result shahriarlabib000@41f4607
Screenshot_2024-09-21-02-37-39-995_org godotengine editor v4 debug

So should i just add them? Instead of changing the size?
Btw thank you very much for your help.

@WhalesState
Copy link
Contributor

WhalesState commented Sep 20, 2024

So should i just add them? Instead of changing the size? Btw thank you very much for your help.

No, this change is just enough for fixing the issue, since it do already expand correctly and fills the popup Window.

Btw thank you very much for your help.

You're welcome ^^

@Mickeon Mickeon modified the milestones: 4.x, 4.4 Oct 24, 2024
@Repiteo Repiteo merged commit 7974ba5 into godotengine:master Oct 24, 2024
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 24, 2024

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.

6 participants