-
Notifications
You must be signed in to change notification settings - Fork 59
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
Label alignment not centred when setting a requisition on the label #27
Comments
I have a fix for the alignment, though I've bundled it in with the ability to set text justification in the Misc class. I have also added the Misc class via inheritance to the button and togglebutton classes. This provides left, centre and right justification. If you are interested in this at all, let me know and I'll send a pull request so you can review the code. |
Send a pull request. 😉 I'll review it and provide feedback. We tend to like individual pull requests for each feature, but if you don't feel like splitting them up, I can edit your commits myself. |
Added the ability to justify text (left, centre, right) for a button, togglebutton and label, which also Fixes TankOs#27. Examples have not been created as yet, and current examples impacted by this change have not been updated. I'll do this once the change is approved.
When setting a fixed width for a label using SetRequisition, the label will not be centered, but will be left justified.
Brew code snippet from Label.cpp:
This issue is I believe is line 24 where the GetRequisition.x is the same size as GetAllocation.width, as your available space will be 0. It doesn't matter what Alignment you assign, it will always be 0 if this is the case (Left Justified).
Sample code snippet, I have modified the alignment of 'File' to be the far right of the label for demonstration.
Please see the position of 'File' in the image below, it should be at the far right hand side of the 633.0f label, but instead it is at the far left.
![lablebug](https://cloud.githubusercontent.com/assets/9457205/10938738/8ac8e886-8350-11e5-9b68-ae8b9cef07e7.png)
I'll do some playing around to see if I can fix it myself.
The text was updated successfully, but these errors were encountered: