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

ItemList text threshold for truncating with ellispis (...) may need changing #97125

Open
tetrapod00 opened this issue Sep 17, 2024 · 1 comment

Comments

@tetrapod00
Copy link
Contributor

Tested versions

4.3

System information

Windows 10

Issue description

In an ItemList, names are truncated if they are too wide for the list. Usually this is done with an ellipsis ..., but when the width is small enough, no ellipsis is used, so more of the original name is preserved. This is good behavior, otherwise a label like new_script.gd, truncated to 5 characters, would appear as ne... rather than new_s.

There is some threshold for when truncation stops using ellipses. Possibly this threshold should be changed, so that ellipsis truncation is used for more narrow controls than it currently is.

The exact logic may also need tweaking. In this example, the list item named wwwwwwwwwwwwww is truncated without an ellipsis, even though visually it has room for an ellipsis.

Observed behavior in the MRP:

Godot_v4.3-stable_win64_LBndWrQWhk.mp4

Context:
I first noticed this behavior when testing #96909. That PR changed the minimum width of the script list to 100, and now the width is small enough that many script names are truncated with no ellipsis.

Observed behavior in the #96909 artifact. Not how new_script.cs file is truncated without ellipsis.

godot.windows.editor.x86_64_gaLLMuQTjM.mp4

Steps to reproduce

Open the MRP.
Adjust the HSplitContainer left and right. You can test with and without 16x16 icons.
Observe that at a certain width, some labels are truncated using an ellipsis and some are not.

Minimal reproduction project (MRP)

mrp-truncation.zip

@aXu-AP
Copy link
Contributor

aXu-AP commented Sep 17, 2024

It seems that this behavior isn't unique to ItemList, but in general any TextParagraph with text_overrun_behavior = OVERRUN_TRIM_ELLIPSIS
Here's demonstration with Label:
ellipsis
Note how there's a brief moment when "new_s" is shown, there would be space enough for either one letter or ellipses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants