imgui
imgui copied to clipboard
Single line Input box contents align right.
Added new flag: ImGuiInputTextFlags_AlignRight. Added implementation in InputTexEx().
Hello,
Referencing your issue #1440
Some comments:
-
AFAIK this only works when not editing the text and then jumps back to the left, wouldn't that be a problem for you? That's the number one question I have.
-
If it's a flag and it doesn't work for multiline then it it should assert against that.
-
However if you are going to use this flag everywhere in your code (is that the case?), I think this could be exposed in the style structure as e.g.
ImVec2 InputTextAlign(to mimicButtonTextAlign) ? -
The code doesn't follow the general coding style of imgui (no space after //, tabs instead of space)
(The lack of proper single-line and multi-text text alignment primitives is a long standing issue we ought to fix! Probably for an upcoming cleanup of the internals.)
Omar
Yes, while the field is being edited, the right alignment is lost. Even with that, it considerably broadens the use for listing editable fields for numbers, in the form of a sum for instance. Good enough for me for the time being.
About the flag's assert, I believe it is already set and working. I am not sure if there is something else I missed.
As for the other considerations, this is definitely meant as a workaround more than a solution, for an emergency on my end. As you say, the issue is much deeper than just a couple lines. However, depending on when the nice way can be attended to, it might make sense to include this as a temporary convenience. Your call.
I corrected the coding style. Also, if you believe it is worth it, I might be able to find a slot for the style approach.
We've been using this in production for a few months now, and didn't have any issues until now. Would it be possible to get this merged ? Is anything holding it back ?
+1 for requesting this feature
It would be great to get this feature in. In the meanwhile here's a hack that I did, which does not require changes to imgui itself (but needs access to internal data structures).
https://gist.github.com/petrihakkinen/c2462974ad41f72a54d9aaf2d62b2536