-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 ItemList text trimming #97439
Fix ItemList text trimming #97439
Conversation
If the minimum right margin is the same size as the left margin, the text is cut off as it cannot be displayed completely in the center of the ItemList at this size. (see image) If you set the Therefore, I thought if there is enough space for the text, it should be displayed and it would be symmetrical if you enable the auto_width function (#93270). (see video 2) Video 1
2024-09-25.17-04-24.mp4Video 2
2024-09-25.17-12-36.mp4 |
The autowrap margin takes the scroll bar into account, even if it is not visible. Before
2024-09-25.17-38-37.mp4After
2024-09-25.18-05-42.mp4 |
17ee4f4
to
554f73a
Compare
This happens when adding |
@WhalesState I don't think I quite understood your comment. |
Seems like you already have fixed that, but i have found a regression.
Already an existing issue:
ItemList.mp4 |
554f73a
to
ed4d2bd
Compare
Fixed
I have added if statements so that
This was apparently intentionally removed. (#82236) |
I think we can't use property hints or setters for theme constants, you will have to clamp them everytime if the negative values will cause issues. you can use |
ed4d2bd
to
5e2e140
Compare
@KoBeWi What you think of my comment on the symmetry of the minimum margin? (#97439 (comment)) |
5e2e140
to
b0bf9d2
Compare
b0bf9d2
to
6a9e50b
Compare
So I did an experiment to test the new behavior. I made a StyleBox with 0 content margins and borders equal to Here's old behavior: godot_TeUIK8bHkk.mp4It uses half separation on the left and full separation on the right. Here's new behavior: godot.windows.editor.dev.x86_64_XuH2iyyjRB.mp4Half separation on the left, right separation is ignored. I think both are sort of inconsistent, but the new one is more friendly, as there is more space. |
So it would be good for now, and we could open a discussion on better consistency if that is needed? |
Yeah, overall it's an improvement. |
Should I rebase the branch or does this happen automatically when merging? |
Rebasing is only needed if there are conflicts, or sometimes when a PR is very old and wasn't recently updated. |
Thanks! And congrats for your first merged Godot contribution 🎉 |
This fixes #97438
The left content margin was probably calculated as an offset by the
get_size()
function in the line above, but I couldn't check that, because I haven't found the function. If this needs to be changed please tell me where to find it.Video showing the resolved issue
2024-09-25.13-04-00.mp4