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

Add text alignment to SliderFloat just like Button #1561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add text alignment to SliderFloat just like Button #1561

wants to merge 1 commit into from

Conversation

DomGries
Copy link
Contributor

To make this generic I would suggest renaming ButtonTextAlign to TextAlign and using it for many other controls as well. Alternatively adding multiple text align styles for each control type would be possible too although not necessary since this style can be edited before drawing each control by the user. This would have no performance impact as RenderTextClipped already processes alignment anyway.

To make this generic I would suggest renaming `ButtonTextAlign` to `TextAlign` and using it for many other controls as well. Alternatively adding multiple text align styles for each control type would be possible too although not necessary since this style can be edited before drawing each control by the user. This would have no performance impact as `RenderTextClipped` already processes alignment anyway.
@ocornut ocornut added the style label Jan 20, 2018
@ocornut
Copy link
Owner

ocornut commented Jan 20, 2018

Thanks for the PR.

I agree this is desirable. There's however a catch with applying it to every widgets: text editable widgets currently needs to left aligned to be able to aim with the mouse cursor. Ideally the internal code for InputText() should support alignment, I could work on what.

Would you mind sharing a screenshot of how you are currently aligning things with your patch?

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

Successfully merging this pull request may close these issues.

2 participants