mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 14:16:36 +00:00
Nav: Hovering MenuItem/Selectable with mouse makes NavId, matching what seems to be Windows beahvior at least for menus (#323)
This commit is contained in:
parent
30c04d0dbe
commit
43ee5d73e9
@ -9484,6 +9484,13 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
|||||||
if (flags & ImGuiSelectableFlags_Disabled)
|
if (flags & ImGuiSelectableFlags_Disabled)
|
||||||
selected = false;
|
selected = false;
|
||||||
|
|
||||||
|
// Hovering selectable with mouse updates NavId accordingly so navigation can be resumed with gamepad/keyboard (this doesn't happen on most widgets)
|
||||||
|
if (hovered && !g.NavDisableMouseHover && (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f))
|
||||||
|
{
|
||||||
|
g.NavDisableHighlight = true;
|
||||||
|
SetNavId(id);
|
||||||
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
if (hovered || selected)
|
if (hovered || selected)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user