Open Jamie-Booth opened 8 years ago
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. :wink:
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.
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.
I'll do some playing around to see if I can fix it myself.