Closed yukyduky closed 10 months ago
Looks great! Thanks so much. Will let others review :+1:
That's great.
I think it would be cool to add another option to disable all widgets on window. For example add flag like NK_WINDOW_DISABLED
. We already have NK_WINDOW_NO_INPUT
, but it's useless (i think).
I understand that this flag handles different purpose. But I think no one need just disable input without any visual effect of this.
Neat idea! I personally don't need that atm, but I already have an idea of how to add it so I'll look into it.
By the way, is it good to change style parameters for every widget and restore them back every time? If I'm using only buttons in my GUI, can I change only button style? I don't know lot about how compilers works (does he enough clever to remove unnecessary assignments??), but.. I go crazy when I think about the speed of programs... If there is no other options to do this or this just how such things works, then ok.. I'm just beginner programmer.
Is setting the style only for the ones you want faster? Yes. Is it a significant amount? No. I know it looks bad, but it's really not. The alternatives may be slightly faster, but are more cumbersome to deal with for very little gain.
I'll check this asap
I will try and fix this ASAP :)
Should be fixed now. I made the widget disabling example be one level further out so that it can also be applied to charts etc.
@yukyduky Thanks for the functionality and efforts after the review ;-)
I've added functions to disable widgets and gray them out. You use it like this:
nk_widget_disable_begin(ctx); nk_widget(...); nk_widget(...); nk_widget(...); nk_widget_disable_end(ctx);
There's a variable in each style struct in case you want to change the gray out factor per widget type. So far I've only tested it on the widgets in overview.c. Let me know if you have any issues :)