-
-
Notifications
You must be signed in to change notification settings - Fork 10.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
Single line Input box contents align right. #1442
Conversation
Added new flag. Added implementation in InputTexEx().
Hello, Referencing your issue #1440 Some comments:
(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. |
We've been using this in production for a few months now, and didn't have any issues until now. |
+1 for requesting this feature |
0c1e5bd
to
bb6a60b
Compare
8b83e0a
to
d735066
Compare
b3b85d8
to
0755767
Compare
c817acb
to
8d39063
Compare
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 |
I have now pushed d78e823 to support this.
Thanks @kucoman ! |
I should also mention that while I believe a majority people wanted left-elision for displaying path/file names, the suggestion of "right alignment" really confused/threw me off as it meant something different. My comment about exposing this in the style structure doesn't really make sense for this specific purpose, which is clearly desirable per-instance. (We will later all right-alignment support as a side effect of adding centering.) |
Added new flag: ImGuiInputTextFlags_AlignRight.
Added implementation in InputTexEx().