Open BenjiBoy926 opened 5 years ago
The question seems to be, whether this "background assignment" would work in all cases exactly as the user (programmer) expects. From how I know the styling in Nuklear, I wouldn't rather expect this to be true in all/most cases.
So you mean that sometimes it would happen that I assign
ctx->style.contextual_button = (a button style)
and it might affect something else besides the buttons in the combobox's dropdown list? Because if so then it sounds like even more of an issue. It means I found a way of setting up the style of the buttons in the combobox's dropdown in a way that is invalid and/or undesirable. If that's true, too, I'd like to know the "proper" way of setting up the styles of the buttons in the combobox's dropdown.
It seems to boil down to the fact, that styling in Nuklear is still kind of preliminary and to put it bluntly, there are places in the library, where some "theoretically fitting" user style is taken even though it might not necessarily make sense in all cases (which are very hard to analyze) to avoid harcoding of some style.
Another potential issue is, that combo boxes (and any other "overlapping" pieces) are not first class citizens in Nuklear and because styling is designed rather for first class citizens, there will be definitely some edge cases where it won't work as expected.
Feel free to open a pull request and we'll take a look how it (visually) integrates with the existing demos, etc.
When you ask for a pull request, are you suggesting I actually modify the code, or are you talking about adding an example of a well-styled combobox to the wiki? (Maybe both?)
Code has higher priority, but wiki would be also nice :wink:.
Alrighty! Well, if the pace ever slows here where I work (which isn't very often!) I'll do some digging into the API and see if I can't figure out a good fix. Despite having more than a few kinks that need ironing out, the library is pretty nifty and really well-organized, and it'd be fun to contribute
Oh, also as another question, when you say comboboxes aren't "first class citizens", do you mean that a combobox in itself is only an aggregation of simpler parts, like buttons and contextual panels? Or did you mean something else?
a combobox in itself is only an aggregation of simpler parts, like buttons and contextual panels?
Yep, that's one thing. Another thing is, that everything which "overlaps" anything else is not first class citizen (architecturally) and as such has side effects :cry:. This part was designed later when it became clear, that Nuklear will not be just a super simple planar UI library, but a full featured, though minimal, UI "microframework".
There is another take on a "minimal though full featured" UI library from the same author called Quarks and a UI layouting "theory demonstration", but there is currently no intention to "market it" as we don't have enough time to maintain the community around etc. But Quarks is a masterpiece of anything UI-related I've seen so far (it even transparently supports "full DPI diversity"!).
Quick question @dumblob , if I want to modify the code in this library and start a pull request, should I modify "nuklear.h" in the root directory or should I modify "src/nuklear.h" in the src folder?
Modify src/nuklear.h
and then follow instructions in src/Readme.md
which will automatically generate nuklear.h
. Don't forget to change version accordingly.
I am currently working with comboboxes in nuklear and was a little thrown off by the fact that the styles of the buttons in the combobox dropdown are not automatically set to the member variable
button
in the structnk_style_combo
This is the code I was using before:
Where
combobox->style
is a struct of typenk_style_combo
. From the assignmentctx->style.combo = combobox->style
alone, I expected the styles of the buttons in the dropdown to have the style I'd set them to incombobox->style.button
(it was a light-blue color, if you're wondering), but in fact the buttons in the dropdown were the same-old default blackish-grey colors.To get the behavior I was expecting, I had to add this line:
As a user, I think it'd be best if nuklear handled this assignment on its own. If I'm going through the trouble of setting up the
nk_button_style
object that's innk_style_combo
, then nuklear should be automatically setting the buttons in the combobox dropdown to this style, rather than forcing me as a user to sit and guess which button style is actually affecting the buttons in the combobox dropdown. (Which took me a few minutes sincecontextual_button
doesn't sound like it has anything to do with comboboxes)