-
Notifications
You must be signed in to change notification settings - Fork 236
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
Question: How to show whole text when text area is added to scene #1243
Comments
Not sure if this will work but let's start with just this:
So no scrollpane and no height property listener. |
@Jugen Thank you very much for your help. I have two problems with the code you provided. This is the first problem. Code:
If you run this code, and after that click on text area you will see that autoheight is not very accurate: Or I do something wrong? |
This is the second problem. It seems that when autoHeight is used then getHeight() returns wrong value in PostLayoutPulseListener. This is my code:
This is output:
And these are real sizes: As you see textArea height is about 120 pixels (but not 100). At the same time label height it correct - 128 pixels. |
With your first code provided above I see what you mean in video but can't replicate on my system ? |
@Jugen About the first problem - I will try to run it on windows and play with font-size. BTW - maybe you could install virtual box with linux? It is very easy ... when it works :). There are also building problems on linux that we discussed. About the second problem, yes, it can explain the flicker. But is it possible to make TextArea calculate height in the first pulse? Or is it impossible? I am asking because |
It seems that the delay only happens the first time the TextArea is rendered. |
@Jugen But we do set width : |
Hmm, the TextArea requires its actual width. Those methods just specify the width limits and preference, not it's final rendered width which will depend on other things as well like the parent containers it is in. You can try the following hack to prepare the messageArea for dialogs and popups: // Dummy scene to trigger initial layout to set width to 500
new Scene( messageArea, 500, 50 ).snapshot( null );
messageArea.appendText( text ); // Must be after
// Add messageArea to the Dialog/Popup container |
@Jugen Can we add something like |
@Jugen Or messageArea.setAutoHeight(true, usePrefWidthForCalculation); |
Have submitted a PR that calculates the height using the preferred width when appropriate as suggested. |
@Jugen I checked maven snapshot for the tests of both problems. Everything seems to work: with output:
Thank you very much for your help. |
Let's assume there is an unknown text with some styles.
Now, I need
As it is seen the problem is that I need whole document height when I only add text area to scene. I tried this code:
This code works, but the problem is that when messageArea becomes visible it has one height and later its height is changed and user sees
flickering
. I tried to addBut it didn't help. Could anyone say how to do it if it is possible?
The text was updated successfully, but these errors were encountered: