Skip to content
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

Funny tooltip behavior if using BeginGroup/EndGroup #849

Closed
usagi opened this issue Sep 27, 2016 · 2 comments
Closed

Funny tooltip behavior if using BeginGroup/EndGroup #849

usagi opened this issue Sep 27, 2016 · 2 comments
Labels

Comments

@usagi
Copy link
Contributor

usagi commented Sep 27, 2016

Code

    ImGui::BeginGroup();
    ImGui::SmallButton( "button" );
    if ( ImGui::IsItemHovered() )
      ImGui::SetTooltip( "BUTTON" );
    ImGui::EndGroup();
    if ( ImGui::IsItemHovered() )
      ImGui::SetTooltip( "GROUP" );

Behavior

  1. We can see the "GROUP" tooltip if hovered.
  2. But, we will see the "BUTTON" tooltip if pressing the button. ( I think it is a funny behavior. )

I think, the correct behavior is show the "GROUP" tooltip in every time. Or, the "BUTTON" in every time.

@ocornut
Copy link
Owner

ocornut commented Sep 28, 2016

Thanks, I will look at it.

ocornut added a commit that referenced this issue Oct 1, 2016
@ocornut
Copy link
Owner

ocornut commented Oct 1, 2016

Should be fixed now. IsItemHovered() will return true for both the button and the group.

(Note that the behavior of SetTooltip() is to overwrite a previous tooltip, whereas BeginTooltip()/EndTooltip() does a regular append.)

ImGui::Begin("Bug #849");
ImGui::BeginGroup();
ImGui::SmallButton( "button" );
if ( ImGui::IsItemHovered() )
    ImGui::SetTooltip( "BUTTON" );
ImGui::EndGroup();
if ( ImGui::IsItemHovered() )
    ImGui::SetTooltip( "GROUP" );
ImGui::End();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants