Commit Graph
284 Commits
Author SHA1 Message Date
Rob Loach 1039f28ea0 Update src/nuklear_slider.c 2026-04-27 10:41:22 -04:00
Rob Loach c82bebc2c3 slider: Fix float type conversion 2026-04-23 09:48:46 -04:00
Rob Loach 7f87c67e52 Increase size so you can actually click them (#924) 2026-04-20 10:09:34 -04:00
Rob Loach 409de195d1 Merge pull request #941 from TomJGooding/docs-layouting-remove-dangling-and
docs: fix typos in layouting documentation
2026-04-20 00:04:32 -04:00
Rob Loach 76d7e8e51e Merge pull request #926 from rswinkle/typos_and_minor_issues
Typos and minor issues
2026-04-17 13:34:28 +02:00
Rob Loach fee5a7c4de docs: Fix Warnings and Notes (#925)
* docs: Fix Warnings and Notes

* docs: Add a space
2026-04-17 12:53:12 +02:00
Robert Winkler ab51b8d387 Update configurator and more (#934)
* 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.
2026-04-17 12:51:55 +02:00
TomJGooding b48694e499 docs: fix typo in nk_layout_space_push docs 2026-04-12 10:05:28 +01:00
TomJGooding 206f05c661 docs(layouting): remove dangling 'and' 2026-04-12 09:17:58 +01:00
Rob Loach 8c9b376376 Fix NK_MEMCPY() size type conversions with nk_size (#913) 2026-03-30 11:03:51 -04:00
Rob Loach d293cc27fa docs: Move the CHANGELOG to Release Notes (#909) 2026-03-25 15:29:07 -04:00
Robert Winkler 88380b4e4b Committed is spelled with two t's
Add macro for backward compatibility
2026-03-24 14:30:02 -07:00
Robert Winkler dcae93cc6f Correct reference to non-existent nk_window_focus 2026-03-24 14:24:20 -07:00
Robert Winkler d52dc65ed2 The plural of vertex is vertices 2026-03-23 18:01:06 -07:00
Robert Winkler 4ec94c871b Increase size so you can actually click them 2026-03-22 20:39:47 -07:00
Robert Winkler 7002929a46 Remove redundant nk_zero_struct() calls 2026-03-16 14:42:46 -07:00
Robert Winkler a2d7087251 Check y for NULL too
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.
2026-03-16 14:36:43 -07:00
Rob LoachandsleeptightAnsiC a9fef84be2 mouse: Add the Back/Forward Mouse Buttons (#906)
* input: Add Back/Foreward Mouse buttons

* rebuild

* Add remaining renderers

* Add mouse tests

* Apply suggestion from @RobLoach

* allegro: Fix switch warning?

* Clean up code

* Update demo/d3d12/nuklear_d3d12.h

Co-authored-by: sleeptightAnsiC <91839286+sleeptightAnsiC@users.noreply.github.com>

* Update demo/d3d11/nuklear_d3d11.h

Co-authored-by: sleeptightAnsiC <91839286+sleeptightAnsiC@users.noreply.github.com>

* Switch input context from d3d9 to gdi for X buttons

* Update context from d3d9 to gdi for XBUTTON events

* Change context from d3d9 to gdip for XBUTTON events

* Refactor mouse button handling in nuklear_allegro5.h

* Fix allegro

* Remove break

* Add doc comments

---------

Co-authored-by: sleeptightAnsiC <91839286+sleeptightAnsiC@users.noreply.github.com>
2026-03-16 09:12:18 -04:00
TomJGooding feb1e321af docs(layouting): fix code blocks
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
2026-03-10 19:19:54 +00:00
Rob Loach 987c8b89eb Return if value changed for property_*() and combobox*() functions (#912) 2026-03-08 17:51:33 -04:00
Robert Winkler 1fb586537b Add Tooltip Positioning (#911)
* 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
2026-03-08 17:50:35 -04:00
Robert Winkler a94e6ed970 Return if value changed for property_*() and combobox*() functions 2026-03-07 23:46:26 -07:00
Robert Winkler 675ce7fc98 Add prefix to problematic stb_truetype equal() func 2026-02-28 16:19:11 -07:00
JS Deck 3010177b45 Fix property edit field value would be discarded on focus lost when clicking on an earlier property 2026-02-16 14:43:49 -07:00
JS Deck b13eccac53 Add cast to nk_strtoi and nk_strtod 2026-02-16 14:32:09 -07:00
JS Deck 9fd14bbe58 Fix property edit field mouse click activation when it's earlier in the window 2026-02-16 14:31:57 -07:00
blueandRob Loach a329721db9 Fixed NK_SIZE_TYPE and NK_POINTER_TYPE on MinGW and Windows clang/clang-cl (#811)
* 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>
2026-02-06 23:52:36 -05:00
sleeptightAnsiC 595a81f2ae Fix(build): replace incorrect static asserts for size(nk_bool)
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
2026-02-06 16:33:10 +01:00
Rob Loach 25f33c8780 Merge pull request #862 from sleeptightAnsiC/fix__math_util_build
Fix several issues related to building from Nuklear/src/* files
2026-02-02 18:57:35 -08:00
sleeptightAnsiC 690f63eaed Fix(build): guard nk_pow, nk_ifloord, nk_log10 with preprocessor
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
2026-01-27 17:34:36 +01:00
sleeptightAnsiC a3c6571e62 fix(demo): nuklear_sdl3_renderer now provides NK_DTOA
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.
2026-01-27 17:33:25 +01:00
sleeptightAnsiC ae9ef5d585 fix(util): guard nk_strtod implementation with preprocessor
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
2026-01-27 17:32:59 +01:00
sleeptightAnsiC ad98bd924c fix(build): failure to build from nuklear/src/* sources
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
2026-01-27 17:29:40 +01:00
Michał Ciesielski 0e872de6ac Fix the comment lines in section headers (#845) 2026-01-26 11:59:11 -05:00
sleeptightAnsiC 7a8e8aa3fc fix(nk_property): nk_do_property now uses NK_STRTOD via macro
nk_do_property was using 'nk_strtod' instead of 'NK_STRTOD'
which was not picking the user-provided implementation of NK_STRTOD

Fixes: https://github.com/Immediate-Mode-UI/Nuklear/issues/851
2025-11-18 20:34:29 +01:00
sleeptightAnsiC ec5e8d711e Add new demo: sdl3_renderer
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...
2025-11-15 22:42:10 +01:00
sleeptightAnsiCandRobert Winkler c4e370b4f0 Fix(nk_property): property widget not updating 'win->edit.active' state
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>
2025-11-15 21:09:09 +01:00
Rob Loach fcd64f85e5 Add nk_input_is_mouse_moved() (#632)
* Add nk_input_is_mouse_moved()

* Move the nk_input_is_mouse_moved() declaration
2025-10-25 10:03:01 -04:00
Rob Loach 530100f938 Merge branch 'master' of github.com:Immediate-Mode-UI/Nuklear into fix_insert_replace_reset 2025-10-25 09:42:46 -04:00
Rob Loach 8fe6f13e6b Merge branch 'master' of github.com:Immediate-Mode-UI/Nuklear into fix-hovered-unicode4 2025-10-25 09:37:03 -04:00
Rob Loach 242f35efa0 Merge pull request #836 from sleeptightAnsiC/fix__nk_widget_text__default_align
nk_widget_text: use left alignment by default instead of silent failing + small refactor
2025-10-25 09:29:41 -04:00
Andrew Kravchuk 1374197ec2 Update source code too 2025-10-22 07:49:36 +02:00
sleeptightAnsiC 6af4e06683 refactor(nk_widget_text): code for X and Y alignment now looks the same
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)
2025-10-08 18:03:56 +02:00
sleeptightAnsiC 83233e8eb9 fix(nk_widget_text): use left align by default, instead of silent fail
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.
2025-10-08 17:32:15 +02:00
PavelSharp c2f210a26e Update CHANGELOG and Rebuild nuklear.h 2025-09-12 03:09:50 +03:00
PavelSharp 109e9bde19 fix: use ctx->current->flags instead of ctx->begin->flags when checking state in nk_window_is_hovered
fix: allow len == NK_UTF_SIZE in nk_utf_decode by adjusting NK_BETWEEN upper bound
2025-09-12 03:09:29 +03:00
Robert Winkler b150778150 Allow switching between INSERT and REPLACE modes, remove useless check 2025-04-28 17:10:44 -07:00
Robert Winkler 912a52c391 Fix error causing crash and only scroll if hovered
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.
2025-04-06 00:26:04 -07:00
Rob Loach d93f4e0b56 Updater to v4.12.7 2025-04-06 00:41:00 -04:00
Robert Winkler ba56482b44 Fix scrolling with mouse and arrows 2025-04-05 00:54:44 -07:00