mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-24 07:40:22 +01:00
Nav: marking NavId as hovered in ButtonBehavior() doesn't check for ActiveId.
Aimed at allowing activating another item with a shortcut without losing NavId. Initial logic fromc2cb2a69
, with minor amendsdb5f1b79c
,cea78cc57
.
This commit is contained in:
parent
d10641b04a
commit
095665977f
@ -47,6 +47,8 @@ Breaking changes:
|
|||||||
Other changes:
|
Other changes:
|
||||||
|
|
||||||
- Nav: keyboard/gamepad activation mark widgets as held to give better visual feedback.
|
- Nav: keyboard/gamepad activation mark widgets as held to give better visual feedback.
|
||||||
|
- Nav: tweak to logic marking navigated item as hovered when using keyboard, allowing
|
||||||
|
the hover highlight to stay even while another item is activated.
|
||||||
- Fixed SetKeyboardFocusHere() not working when current nav focus is in different scope,
|
- Fixed SetKeyboardFocusHere() not working when current nav focus is in different scope,
|
||||||
regression from 1.90.1 related to code scoping Tab presses to local scope. (#7226) [@bratpilz]
|
regression from 1.90.1 related to code scoping Tab presses to local scope. (#7226) [@bratpilz]
|
||||||
- Debug Tools: Metrics: Fixed debug break in SetShortcutRouting() not handling ImGuiMod_Shortcut redirect.
|
- Debug Tools: Metrics: Fixed debug break in SetShortcutRouting() not handling ImGuiMod_Shortcut redirect.
|
||||||
|
@ -599,7 +599,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|||||||
|
|
||||||
// Gamepad/Keyboard navigation
|
// Gamepad/Keyboard navigation
|
||||||
// We report navigated item as hovered but we don't set g.HoveredId to not interfere with mouse.
|
// We report navigated item as hovered but we don't set g.HoveredId to not interfere with mouse.
|
||||||
if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover && (g.ActiveId == 0 || g.ActiveId == id || g.ActiveId == window->MoveId))
|
if (g.NavId == id && !g.NavDisableHighlight && g.NavDisableMouseHover)
|
||||||
if (!(flags & ImGuiButtonFlags_NoHoveredOnFocus))
|
if (!(flags & ImGuiButtonFlags_NoHoveredOnFocus))
|
||||||
hovered = true;
|
hovered = true;
|
||||||
if (g.NavActivateDownId == id)
|
if (g.NavActivateDownId == id)
|
||||||
|
Loading…
Reference in New Issue
Block a user