-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvisibleButton
: add a way to optionally call RenderNavHighlight
inside?
#8057
Comments
You are right. I'm surprised that this hasn't been brought before. I believe the most correct approach would be to add this call in So we'd need make sure that the user know they can use e..g |
A convenient default may to do the opposite:
|
…oNav. (#8057) Not fully honored in ItemHoverable/IsItemHovered, seems more destructive. This is mostly designed to avoid rectangle being rendered by large InvisibleButton() when ctrl+tabbing back to a window with a big one.
…_EnableNav to enable navigation. (#8057)
I have been agonizing a little too much over this... I also polled some users, and as one in particular said "we have 595 calls to InvisibleButton() in our codebase" I though I would play it safe 😆 Pushed 67e5f35, disable nav by default + added There is a possibility that someone would want to use |
Version/Branch of Dear ImGui:
Version 1.91.2
Back-ends:
imgui_impl_sdl2.cpp + imgui_impl_sdlrenderer2.cpp
Compiler, OS:
Windows 10 + MSVC 2022
Full config/build information:
No response
Details:
ImGui::InVisibleButton
is useful for defining custom widgets. However, whenImGuiConfigFlags_NavEnableKeyboard
is specified, the keyboard navigation will work on them in an invisible way.Take the code below for example. If not calling
RenderNavHighlight
, the effect would be like this. It's hard to tell where the navigation goes.It will work well if calling
RenderNavHighlight
. However, asRenderNavHighlight
is an internal function, I think it will be helpful to add a way to callRenderNavHighlight
insideInvisibleButton
. A new button flag may be fine for this change.Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: