* Add missing style items to configurator...
Looks like I forgot knob completely and left out all the color factors
everywhere.
Also more symbols were added since I first wrote this. Will have to
remember to update it again once Rob's latest PR goes through.
In the process I discovered a couple issues, I left some comments just
in case but I'll fix them myself in separate commits.
* Fix knob issues, specifically...
use cursor_width for the cursor width and don't overwrite
the state with HOVER so the knob can actually be ACTIVE so it can
actually use the active colors (background, knob, and cursor).
* Fix slider issues, use style->bar_height, etc.
A remaining issue is that style->cursor_size.y has no effect
on vertex buffer based backends which is probably the majority
of them now.
Also nk_fill_circle and nk_stroke_circle should really be
called _ellipse, even if it's currently broken on vertex buffer
based backends and uses rect.w/2 as the uniform radius.
For x11 it correctly draws a major axis aligned ellipse.
There are some rare cases where the x and y offsets are split across
tables and the table with y gets incorrectly garbage collected in
nk_clear(). This prevents that from causing a segfault.
While browsing the documentation I noticed that the code blocks are
currently broken on the Layouting page.
I confess I'm not familiar with Doxygen, but simply removing a space
from the indentation seems to fix the issue!
Fixes https://github.com/Immediate-Mode-UI/Nuklear/issues/915
* Add basic tooltip positioning
* More flexible tooltip API, allow arbitrary offset
* Simplify and combine functions as discussed...
Combine position and offset parameters a single call using the latter as the
origin. Credit to @sleeptightAnsiC for the obvious idea.
* Add examples to overview, fix vararg versions
* Add more options (vertially centered origins), and more demos
* Simplify naming
* tooltip offsets with a default style
* Minor fixes, update style_configurator with new tooltip styling
* Update nuklear.h
fixed pointer and size type defs for MinGW64
* -- added __clang__ macro for windows clang and clang-cl to also work
* updated the template nuklear.h to fix NK_SIZE_TYPE and NK_POINTER_TYPE
* Update src/nuklear.h
* Apply suggestion from @RobLoach
---------
Co-authored-by: Rob Loach <RobLoach@users.noreply.github.com>
Fixes the issue where you would not be able to provide
your own `bool` symbol when it's sizeof is not equal to 4.
This was bloking all custom code from supplying C99 _Bool,
or C++/C23 bool, or any other custom bool like in case of SDL3 demo.
New checks should be way more sane. The old ones never worked,
despite of comment that you could use `char` for it.
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/849
Those 3 internal functions are only used by nk_dtoa implementation,
which means that you will get -Wunused-function warnings when providing
your own NK_DTOA. Now we are guarding those with NK_DTOA_NEEDED ifdef.
This change was intentionally split into separate commit so it
will be easy to git-bisect and git-revert in case of any issues.
https://github.com/Immediate-Mode-UI/Nuklear/pull/862#pullrequestreview-3480471232
There was a note inside nuklear_sdl3_renderer saying that SDL3 does not
have "dtoa", so I simulated it's behavior with printf. This helps us
test the actual NK_DTOA preprocessor path.
nk_strtod implementation was never guarder by the preprocessor,
so if you ever provided your own NK_STRTOD, the default one would
still be compiled. This fix was intentionally split into another commit,
because the lack of the guard was very suspicious to me...
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/851#issuecomment-3503880414
This fixes an issue, where you would not be able to build Nuklear from
sources (without amalgamated header), caused by nuklear_math/util.c
not declaring some function definitions, due to wrong preprocessor logic.
This fix is an "Option 3" mentioned in following comment...
https://github.com/Immediate-Mode-UI/Nuklear/issues/256#issuecomment-2949725477
... where we define NK_XXX_NEEDED macro at nk_xxx symbol definition
so the preprocessor will be able to correctly detect it in all cases.
Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/256
This is a highly updated demo for libSDL3. It fixes a lot of long
occuring issues and brings some improvements specific to SDL3 API.
The origin and development of this demo is quite long.
The exact track of development is something like this:
`Nuklear/demo/sdl_renderer` -> https://github.com/Immediate-Mode-UI/Nuklear/pull/772 -> https://github.com/Immediate-Mode-UI/Nuklear/pull/779 + https://github.com/Immediate-Mode-UI/Nuklear/pull/825 -> _this_ commit...
You may wish to read the linked PRs in order to get the full context.
Commit message is too small to describe everything. I'm sorry...
Other "editable" widgets are updating the its window 'edit.active' state,
but not nk_property. SDL3 demo needs this in order to hook SDL_SetTextInput.
This patch was initially proposed by https://github.com/rswinkle
The only thing I changed in it, was a removal of 'edit.name' update,
nk_property is not using the name hash, so there is no reason to set it.
Origin: https://github.com/Immediate-Mode-UI/Nuklear/pull/852#issuecomment-3518277340
Co-authored-by: Robert Winkler <rob121618@gmail.com>
Small refactor in nk_widget_text that makes the code look the same
for X and Y axis alignment. Before it was unconditionally setting
the label.y/.h values for NK_TEXT_ALIGN_TOP, instead of doing it
inside of the branch (unlike the other axis), which was quite
confusing and probably the reason why the bug existed here
in the first place (see previous commit for reference)
Fix nk_widget_text to use NK_TEXT_ALIGN_LEFT by default,
instead of silently failing when no x-axis alignment is provided.
For comparison, y-axis does not have this issue and defaults to TOP.
I could see text input being a special case of always eating scroll if
you're active and have the visible cursor in there but I think it makes more
sense to match other subpanels and that's especially true when the text
box doesn't even have enough text to have a scrollbar; it's already a
bit odd that it eats scroll when that's true if you *are* hovering but
I think that's still understandable.
Also remove dead line of code.