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

Preview in Controller should more reflect the final result of the Viewer #34

Open
TheRealSlander opened this issue Sep 4, 2023 · 5 comments
Labels
Improvement/Fix This could be better
Milestone

Comments

@TheRealSlander
Copy link
Contributor

Problem:
After tweaking a bit with the configuration, I found that the "preview" and "side-by-side panels are not reflecting at all the configuration.

For example, if I change the background, foreground colors and text alignment / size, everything is still as default in the previews.

Capture d’écran du 2023-09-04 17-26-28

Even more, the large preview of the text on the Controller is not even what I will have on my Viewer as the screen size is not matching, making configuration impossible without an actual connection.

Possible Solution:
Make the preview/side-by-side RichTextLabels to reflect the one on the Viewer.
To make things to work very well, it could be possible to require a 1st connection so the Viewer can transmit the dimensions of the RichTextLabel to the Controller so we can adapt it to reflect the final result.

@TheRealSlander
Copy link
Contributor Author

This suggestion should help with this issue as well:#29

@voylin voylin added this to the Version 2.0 milestone Sep 5, 2023
@voylin voylin added the Improvement/Fix This could be better label Sep 5, 2023
@voylin
Copy link
Collaborator

voylin commented Sep 5, 2023

For this and #29 to work, we would need the dimensions of the phone screen. Would probably be possible to achieve with a subviewport. But I've been experiencing problems resizing subviewport containers in Godot 4. When setting their inner subwindow size, resizing the subviewport container itself changes the inner subwindow size as well.

@TheRealSlander
Copy link
Contributor Author

TheRealSlander commented Sep 5, 2023

You don't need the size of the screen for that, nor subwindow. If you get the size of the RichTextLabel from the Viewer, it will be simple to put the preview one in the Controller to the same size.

Creating right and left "pushers" using Control nodes with expanding flag in a HBoxContainer will "squeeze" the RichTextLabel until you set its min_width value to the same as the Viewer's one...

The same applies for the height. But to simplify things, you just have to use a CenterContainer and put the Controller's RichTextLabel inside. It will "squeeze" the Label in its center as well, and setting the Label's min_width/height will then do the trick.

The real difficulty would be to handle portrait/landscape orientation and to make the Controller's preview Label to fit in the allocated space. But I don't see a big issue there.

@voylin
Copy link
Collaborator

voylin commented Sep 5, 2023

The View only accept landscape mode. Using the way you mention would be possible, main reason why I was thinking of using a subviewport was to keep the font size similar to what would be seen in the view.

@voylin
Copy link
Collaborator

voylin commented Sep 6, 2023

Was able to quickly fix the alignment and colors of the preview. Making it similar to the screen size of the phone is something which will take more time.
Got added with a6a8818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement/Fix This could be better
Projects
None yet
Development

No branches or pull requests

2 participants