Fix #100784: Truncate Text with Ellipsis inside Number Inputs #115958

Merged
Harley Acheson merged 2 commits from Harley/blender:ClipFloatText into main 2023-12-08 23:40:20 +01:00

2 Commits

Author SHA1 Message Date
Harley Acheson b73291e740 Small changes
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
2023-12-08 13:15:53 -08:00
Harley Acheson 3ef9155858 Fix #100784: Truncate Text with Ellipsis inside Number Inputs
When a property name is shown inside of a numerical input, truncate
with ellipsis if it cannot fit.

---

We current don't truncate with ellipsis for `UI_BTYPE_NUM` and `UI_BTYPE_NUM_SLIDER`, but just remove characters. Probably because these have the complication of looking like "this is long text :0.00" so we have to deal with the trailing value.

This PR just adds an early exit if the string fits. If not the string measurement is done with the length of ellipsis considered. And then inserts that character at the end if it can.
2023-12-08 13:10:39 -08:00