Tooltips: Added SetItemTooltip(), BeginItemTooltip(). Improved Demo section.

This commit is contained in:
ocornut
2023-06-16 16:42:56 +02:00
parent 0f72652c2d
commit b60acfa87d
6 changed files with 124 additions and 61 deletions

View File

@ -51,10 +51,18 @@ Other changes:
from style.HoverFlagsForTooltipMouse or style.HoverFlagsForTooltipNav. (#1485)
- style.HoverFlagsForTooltipMouse defaults to ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort
- style.HoverFlagsForTooltipNav defaults to ImGuiHoveredFlags_NoSharedDelay | ImGuiHoveredFlags_DelayNormal
- IsItemHovered: Tweaked default value of style.HoverDelayNormal from 0.30 to 0.40,
Tweaked default value of style.HoverDelayShort from 0.10 to 0.15. (#1485)
- Tooltips: Added SetItemTooltip() and BeginItemTooltip() functions.
They are shortcuts for the common idiom of using IsItemHovered().
- SetItemTooltip("Hello") == if (IsItemHovered(ImGuiHoveredFlags_Tooltip)) { SetTooltip("Hello"); }
- BeginItemTooltip() == IsItemHovered(ImGuiHoveredFlags_Tooltip) && BeginTooltip()
The newly added ImGuiHoveredFlags_Tooltip is meant to standardize mouse hovering
delays and rules for a whole application.
The previously common idiom of using 'if (IsItemHovered()) { SetTooltip(...); }' won't
use delay or stationary test.
- Tooltips: Tweak default offset for non-drag and drop tooltips so underlying items
isn't covered as much. (Match offset for drag and drop tooltips)
- IsItemHovered: Tweaked default value of style.HoverDelayNormal from 0.30 to 0.40,
Tweaked default value of style.HoverDelayShort from 0.10 to 0.15. (#1485)
- Tables: Fixed a regression in 1.89.6 leading to the first column of tables with either
ScrollX or ScrollY flags from being impossible to resize. (#6503)
- Clipper: Rework inner logic to allow functioning with a zero-clear constructor.
@ -64,6 +72,7 @@ Other changes:
moved below the lowest blocking modal (rather than the highest one). (#4317)
- Debug Tools: Added 'io.ConfigDebugIniSettings' option to save .ini data with extra
comments. Currently mainly for inspecting Docking .ini data, but makes saving slower.
- Demo: Added more developed "Widgets->Tooltips" section. (#1485)
- Backends: OpenGL3: Fixed support for glBindSampler() backup/restore on ES3. (#6375, #6508) [@jsm174]
- Backends: GLFW: Accept glfwGetTime() not returning a monotonically increasing value.
This seems to happens on some Windows setup when peripherals disconnect, and is likely