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

Tooltip will keep auto expanding if there are 2 tables inside #3162

Closed
Kyuusokuna opened this issue Apr 25, 2020 · 1 comment
Closed

Tooltip will keep auto expanding if there are 2 tables inside #3162

Kyuusokuna opened this issue Apr 25, 2020 · 1 comment

Comments

@Kyuusokuna
Copy link

Dear ImGui 1.77 WIP (17601)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201703
define: _WIN32
define: _WIN64
define: _MSC_VER=1925
define: __clang_version__=10.0.0 
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_win32
io.BackendRendererName: imgui_impl_dx11
io.ConfigFlags: 0x0000C441
 NavEnableKeyboard
 DockingEnable
 ViewportsEnable
 DpiEnableScaleViewports
 DpiEnableScaleFonts
io.ConfigViewportsNoDecoration
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigWindowsMemoryCompactTimer = 60.0f
io.BackendFlags: 0x00001C0E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1264.00,761.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Version/Branch of Dear ImGui:

Version: 1.77 WIP
Branch: Tables merged into docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler: clang 10
Operating System: Windows 10

My Issue/Question:

If there are 2 tables in a tooltip the tooltip will keep auto expanding.
I could not make this happen with only 1 table.

Screenshots/Video

66cb4383-487d-42f3-96b2-561a2564b234

Standalone, minimal, complete and verifiable example:


ImGui::Begin("Bug Report");

ImGui::Text("Test Tooltip");
if(ImGui::IsItemHovered()) {
    ImGui::BeginTooltip();
    
    if(ImGui::BeginTable("Table1", 2)) {
        ImGui::TableSetupColumn("Header1");
        ImGui::TableSetupColumn("Header2");
        
        ImGui::TableAutoHeaders();
        
        ImGui::TableNextRow();
        
        ImGui::TableSetColumnIndex(0);
        ImGui::Text("%s", "Test1");
        
        ImGui::TableSetColumnIndex(1);
        ImGui::Text("%s", "Test2");
        
        ImGui::EndTable();
    }
    
    if(ImGui::BeginTable("Table2", 2)) {
        ImGui::TableSetupColumn("Header3");
        ImGui::TableSetupColumn("Header4");

        ImGui::TableAutoHeaders();
            
        ImGui::TableNextRow();
        
        ImGui::TableSetColumnIndex(0);
        ImGui::Text("%s", "Test3");
        
        ImGui::TableSetColumnIndex(1);
        ImGui::Text("%s", "Test4");
        
        ImGui::EndTable();
    }
    
    ImGui::EndTooltip();
}
ImGui::End();

@ocornut
Copy link
Owner

ocornut commented May 13, 2020

Hello,
Thanks for reporting this!
This should now be fixed by 9d0789d
In addition, the way non-scrolling-x tables reported their contents wasn't enough for 01f30a2 adds some fixes to makes AlwaysAutoResize windows such as tooltip use a best-fit width in that situation.

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

No branches or pull requests

2 participants