-
Notifications
You must be signed in to change notification settings - Fork 563
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 Options to Checkboxes and Radios #592
Add Text Alignment Options to Checkboxes and Radios #592
Conversation
…into offical/align_widgets # Conflicts: # demo/common/overview.c # nuklear.h # src/nuklear_toggle.c
7dcaa79
to
44bd238
Compare
Instead of doing an API breaking change, I would implement functions with extra parameters, and make the original ones using the new functions with the default alignment (left) as argument. This avoiding a major version change and keeping existing code base working. |
Alright, I was a bit skeptical if it would be accepted as is^^ I can fix that tomorrow :) |
I was also going to ask if I should've consolidated the alignment enums into one for both text and widgets but I'll take that as a no since that would also become a breaking change? |
Fixed the API break. |
Oh, this is a great addition. Haven't tested yet, or read through the code, but it's looking great. Anything else you'd like to get in for it? |
Anything else? Do mean like apply alignment to other widgets as well? |
Anything else you'd like to add to this Pull Request. Seems feature-complete, and other widgets could be in follow ups. Your call. |
I think this will do for this PR. I would add more widgets, but I am unsure how they should act when aligned because all widgets I can think of take up all of the allocated space. If I come up with a way to do it then I will submit another PR :) |
I recheck asap. @RobLoach I second voice to keep it only with actual features in this PR, to enable a faster review and merge, unless you see that enabling to other widgets in the future would break the new API for alignment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me with a minor chore style fix :)
@@ -47,7 +47,11 @@ nk_draw_checkbox(struct nk_command_buffer *out, | |||
text.text = style->text_normal; | |||
} | |||
|
|||
text.text = nk_rgb_factor(text.text, style->color_factor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more strict with Nuklear source code: keep the indenting style (4 spaces instead of a tab), to repeat on all files in src
Fixed the issue and also set my IDE to use spaces for tabs from now on :) |
nuklear.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't rebuild nuklear.h from sources
Whoops! Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems good for merging. Needing another reviewer before merging.
Thanks for that contribution :)
This PR adds alignment to check boxes and radio buttons. Originally I was annoyed at not being able to set what side the text appears on and how much space there was between the widget and the text without making a separate label widget and set out to add alignment to all widgets. I then quickly realized that most widgets take up all of their allocated space so it doesn't apply to them in the same way. If there is any widget that could use this that I have missed, please let me know :)
Anyway, here is how it looks: