67 Commits
Author SHA1 Message Date
Robert Winkler 4a6686d746 menu: switch to a hovered title while another menu is open
Once a menu is open, moving the pointer onto another title closes the
first and opens the second. Text, image, and symbol titles all do this.
2026-11-29 16:13:24 -05:00
Robert Winkler fa7240a788 Fix unnecessary combo flips
When user given height is less than content height, use that (will have
a scrollbar) so we don't flip unnecessarily

Opposite of Menu example of larger than needed requested height, in
which case we use real content height to determine whether to flip
2026-11-26 01:36:11 -05:00
Robert Winkler 7fee1db123 Same unecessary scrollbar issue for combos 2026-11-26 01:36:11 -05:00
Robert Winkler f1b960e4b2 Fix the same bug for contextual menus, then a related bug for unnecessary scrollbars 2026-11-26 01:36:11 -05:00
Robert Winkler bd7d582f4c Fix bugs: Use real height not user given max height...
...for determining whether a popup will fit as a dropdown vs needing to
drop "up".

Additionally, pin the direction so a popup menu won't flip back and
forth as you expand/collapse a tree inside of it.
2026-11-26 01:36:11 -05:00
Robert Winkler a0f5b25bb1 Fix some bugs in menus/combos (flickering) and context menu insufficient width handling 2026-11-26 01:36:11 -05:00
Robert Winkler fb492abf08 First pass at smart popup positioning when it's clipped by window 2026-11-26 01:36:11 -05:00
Robert Winkler 5b6f8b1d2b Fix related sizing issues with combos and tree_elements 2026-09-10 10:53:19 -04:00
Robert Winkler 96663736f2 Fix incorrect tooltip width 2026-09-10 10:53:19 -04:00
Robert Winkler e3e18dc1e4 Forgot to update Makefile for new CI stuff 2026-09-05 13:23:49 -04:00
Robert Winkler 44fb5944e2 First pass at link widget 2026-09-05 13:23:49 -04:00
Robert Winkler a1856105f4 Let user choose property precision 2026-09-01 23:42:30 -04:00
Robert Winkler 859d17b71a Add Delayed Tooltips (#943)
* Add nk_input_is_mouse_hovering_delay_rect() to implement delayed popups

* Add tooltip convenience functions, and a default delay used only with appropriate convenience function

* Add 2 input hovering motionless input functions, use delayed version for delayed tooltips

* Add tooltip disappears when item is clicked functionality

* Add Doxygen comments above definitions
2026-05-26 11:34:03 -04:00
Robert Winkler 063968520f demo: Quality of Life updates
- Meaningful titles across all Demos
- Switch to CTRL+Q to exit the demos
2026-04-20 10:07:02 -04: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
Robert Winkler 2880afd0a9 Add C linkage 2026-04-11 19:15:04 -07:00
Robert Winkler a23c9b04de Fix minor sdl3_renderer issues 2026-04-11 15:53:39 -07: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
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
Robert Winkler b150778150 Allow switching between INSERT and REPLACE modes, remove useless check 2025-04-28 17:10:44 -07:00
Robert Winkler 6161712a6a Fix allegro backend key event issues 2025-04-28 16:50:15 -07:00
Robert Winkler c5f4ee59e4 Add insert/overwrite/reset to allegro backend 2025-04-28 14:55:35 -07:00
Robert Winkler 9c3dbb1647 Add insert/overwrite/reset to windows backends 2025-04-28 12:30:36 -07:00
Robert Winkler 369b5b9e15 Add insert/overwrite/reset to glfw backends 2025-04-27 13:43:32 -07:00
Robert Winkler b4c29958b2 Add insert/overwrite/reset to x11 backends 2025-04-27 12:40:15 -07:00
Robert Winkler 35777ae72d Add insert/overwrite/reset to SDL backends 2025-04-27 12:05:32 -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
Robert Winkler 31bad19d49 Leave a clean workspace 2025-04-05 23:26:21 -07:00
Robert Winkler ba56482b44 Fix scrolling with mouse and arrows 2025-04-05 00:54:44 -07:00
Robert Winkler 2ebc533f53 Use whitespace as default word boundaries 2025-04-04 15:25:46 -07:00
Robert Winkler ef5c596866 Fix word movement (CTRL+LEFT/RIGHT) 2025-04-04 15:18:43 -07:00
Robert Winkler 91a6e773a1 Fix knob scrolling and remove some dead code 2025-03-05 13:55:15 -07:00
Robert Winkler fd2c65efef Fix stupid copy-pasta typos 2025-02-28 22:25:40 -07:00
Robert Winkler 1c825c437a Did glfw_vulkan and added fb_scale too 2025-02-28 22:25:40 -07:00
Robert Winkler 05309665e9 Do glfw_opengl2 and 4, some more improvements 2025-02-28 22:25:40 -07:00
Robert Winkler a2af701759 Fix GLFW repeat behavior correctly this time 2025-02-28 22:25:40 -07:00
Robert Winkler 6126312df3 Add support for right control to sdl backends 2025-02-28 22:18:12 -07:00
Robert Winkler f3d9f45b8d Add Numpad Enter support for windows backends... 2025-02-21 23:24:47 -07:00
Robert Winkler e3ae224891 Add numpad enter to allegro demo 2025-02-21 23:13:58 -07:00
Robert Winkler 033cb84d50 Fix allegro5 demo font path 2025-02-21 23:11:10 -07:00
Robert Winkler ff976c2296 Add numpad enter to xcb_cairo backend...
SFML seems to already treat both regular Return and Numpad
Enter as sf:Keyboard:Enter (which I changed because sf:Keyboard:Return
is deprecated.  But SFML seems to have some other weird input bug.
2025-02-21 23:04:36 -07:00
Robert Winkler 793a795dec Add numpad enter to x11 backends 2025-02-21 22:23:29 -07:00
Robert Winkler 706a56aadc Add numpad enter to GLFW backends...
GL4 demo is crashing for me but it's nothing to do with my change
2025-02-21 21:47:46 -07:00
Robert Winkler 9246fdf391 Support numpad Enter with SDL backends 2025-02-02 09:40:18 -07:00
Robert Winkler 0f90945214 Fix/update 2024-11-25 23:59:26 -07:00
Robert Winkler 2282b6c4a5 Fix copy-paste error 2024-11-25 23:59:26 -07:00
Robert Winkler 8a9d5dbec7 Compile as C89 -pedantic -Wall with no warnings 2024-11-25 23:59:26 -07:00
Robert Winkler cc98290283 rebase 2024-11-25 23:59:26 -07:00
Robert Winkler 2327f81a7d Pass color array in as a parameter 2024-11-25 23:59:26 -07:00
Robert Winkler a444e04745 Added additional button text alignments 2024-11-25 23:59:26 -07:00
Robert Winkler e0685b656c rename and improve style_colors to style_global_colors
Now it only updates the colors after one of the dropdowns has been
clicked, not every frame that the tree/tab is expanded
2024-11-25 23:59:26 -07:00
Robert Winkler ab6aee42d8 Remove unnecessary comments 2024-11-25 23:59:26 -07:00
Robert Winkler b51d4ac564 Make symbols array static global 2024-11-25 23:59:26 -07:00
Robert Winkler fb462a31e6 Finished style_vec2 2024-11-25 23:59:26 -07:00
Robert Winkler 2a09e519f3 Finished style_item_color 2024-11-25 23:59:26 -07:00
Robert Winkler d7d6280033 Finished using style_rgb, started style_item_color 2024-11-25 23:59:26 -07:00
Robert Winkler ec430918d5 First draft 2024-11-25 23:59:26 -07:00
Robert Winkler b6d5293dfb Add NK_KEYSTATE_BASED_INPUT changes to src files
Updated nuklear_input.h CHANGELOG and HEADER and regenerated nulear.h
2018-10-31 12:42:30 -07:00
Robert Winkler 1a6c30693f Add NK_KEYSTATE_BASED_INPUT documentation comment 2018-10-30 16:51:45 -07:00
Robert Winkler 36a8d2a5ad Fix issue 548
The issue was introduced in the fix for 416 (commit 8559aeb).

The original problem was (backspace and arrows moving too fast) is not a
nuklear problem but a GLFW problem.  Because of the way nuklear handles
input (it must be between input_begin and end), the key callback method
GLFW offers is not an option.

So we have to use glfwGetKey() which returns the current state of a key
not whether it was just pressed or released, so nuklear acts like it
was pressed every single frame, hence the "too fast" problem.

The fix checks for state change and discards the event if there was
no change.  This kills key repeat behavior (for named keys) on
*all* platforms which makes deleting or arrowing inconvenient.

Since there's no way to fix the shortcomings of a callback vs event
based input API, my "fix" just makes the original fix conditional
on a macro NK_KEYSTATE_BASED_INPUT
2018-10-30 00:43:01 -07:00