Skip to content

Synchronized table resize border doesn't register mouse input when height are differents #3955

Closed
@sinisastevanovic

Description

Version/Branch of Dear ImGui:

Version: 1.83 WIP
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Operating System: Win10

My Issue:

When creating two or more Tables with the same ID (so the column width is synced) and TreeNodes as content,
the line where you resize the columns doesn't register mouse input correctly when TreeNodes are expanded only in one of the tables.

Is this intended? If so, how can I sync the column width without sharing the ID?

Screenshots/Video

Screenshot 2021-03-21 152447

Sample Code
`

    ImGui::Begin("Test1");
    for (int j = 0; j < 2; j++)
    {
        ImGui::Separator();
        static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_RowBg;
        float minRowHeight = 30.0f;
        if (ImGui::BeginTable("table_test", 2, flags))
        {
            ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_WidthStretch, 0.5f);
            ImGui::TableSetupColumn("Value", ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_WidthStretch, 0.5f);
            for (int i = 0; i < 5; i++)
            {
                ImGui::TableNextRow(0, minRowHeight);
                ImGui::TableSetColumnIndex(0);
                std::string propName = "Hello " + std::to_string(i);

                if (ImGui::TreeNodeEx(propName.c_str(), ImGuiTreeNodeFlags_SpanFullWidth, propName.c_str()))
                {
                    for (int h = 0; h < 5; h++)
                    {
                        ImGui::TableNextRow(0, minRowHeight);
                        ImGui::TableSetColumnIndex(0);
                        ImGui::Text("\t\tChild");
                        ImGui::TableSetColumnIndex(1);
                        ImGui::Text("ChildValue");
                    }

                    ImGui::TreePop();
                }
            }
            ImGui::EndTable();
        }
    }

    ImGui::End();`

Activity

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

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions