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
...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.
* 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
* 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.
* 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
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.
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.
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