-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Label with text overrun behaviour ellipsis inside HBox gets trimmed completely #56915
Comments
Does using Fill and Expand not work for what you're trying to do? |
No, using Expand results in the image above. It cuts off the labels before it, and pushes away labels after it. |
@stijn-h Can you still reproduce this on 4.2.2 or later, or is the issue resolved? |
@Calinou It doesn't seem like a bug, but more like a 'potentially missing feature' to me. I closed it since I personally no longer need this anymore, and it doesn't seem like anybody else does, either. |
(Coincidentally ran into this issue a few days after looking at the relevant code, just dumping some info) The root cause is that there is no way for the label to set/advertise a preferred size to the parent container, only a minimum size, when being laid out by the parent. Since text overrun handling means that there is no technical minimum size, as it can be handled by ellipsis etc, it doesn't bother to compute that and ends up with a minimum width of 1px. Even if the parent container has enough size, it'll still use that 1px minimum size when expand isn't set. Ideally IMO the label would always compute a target size and the parent container would then size it between that and the minimum size (or greater if expand is set) but afaik this is a design limitation with the current UI stuff. |
Godot version
8958e1b
System information
W10
Issue description
Consider two labels inside an HBoxContainer, both with ellipsis. With just a horizontal size flag of FILL, they are both completely invisible:
. Adding the EXPAND flag does make them show up:
but it always forces both labels to take the same amount of space. This can be a problem when one of the labels is shorter than the other:
So I can't use EXPAND for my use case. I would like to see FILL work this way:
Steps to reproduce
Make a scene like this:
Configure both Labels with some text, horizontal size flag FILL, overrun behaviour -> trim_ellipsis
Both labels should now be invisible (see file below).
Minimal reproduction project
test.zip
The text was updated successfully, but these errors were encountered: