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

OuterRect of Tables overlap what is placed on his right (cause issue for move scrollbar) #3704

Closed
aiekick opened this issue Jan 9, 2021 · 3 comments

Comments

@aiekick
Copy link
Contributor

aiekick commented Jan 9, 2021

Current/Master:

Version: Current
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl.cpp
Compiler: MSVC
Operating System: Win 10 x64

My Issue/Question:

I have an issue in my app when i use table with another widgets on the right side.
the scrollbar is difficult to manipulate due to overlaped widgets :

Screenshots/Video

9JHmkMVdlz

Standalone, minimal, complete and verifiable example:

{
            ImGui::Begin("Table issue");
            static ImGuiTableFlags flags = ImGuiTableFlags_SizingPolicyFixed | ImGuiTableFlags_RowBg |
                ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_NoHostExtendY;
            if (ImGui::BeginTable("##fileTable", 3, flags, ImVec2(300,0)))
            {
                ImGui::TableSetupScrollFreeze(0, 1); // Make header always visible
                ImGui::TableSetupColumn("aaaa", ImGuiTableColumnFlags_WidthStretch, -1, 0);
                ImGui::TableSetupColumn("bbbb", ImGuiTableColumnFlags_WidthAuto, -1, 1);
                ImGui::TableSetupColumn("cccc", ImGuiTableColumnFlags_WidthAuto, -1, 2);
                ImGui::TableHeadersRow();
                ImGui:ImGuiListClipper clipper;
                clipper.Begin(20, ImGui::GetTextLineHeightWithSpacing());
                while (clipper.Step())
                {
                    for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
                    {
                        if (i < 0) continue;

                        ImGui::TableNextRow();
                        if (ImGui::TableSetColumnIndex(0)) ImGui::Text("AAAA");
                        if (ImGui::TableSetColumnIndex(1)) ImGui::Text("BBBB");
                        if (ImGui::TableSetColumnIndex(2)) ImGui::Text("CCCC");
                    }
                }
                clipper.End();
                ImGui::EndTable();
            }

            ImGui::SameLine();

            ImGui::BeginChild("##FileTypes");
            static float sliderValue = 0.0;
            for (int i = 0; i < 20; i++)
                ImGui::SliderFloat("slider", &sliderValue, 0, 100);
            ImGui::EndChild();

            ImGui::End();
        }

the result with the repo. see whith scrollbar the OuterRect are overlaped's

jt7CX5SNWg

@aiekick aiekick changed the title OuterRest of Tables overlap what is placed on his right (cause issue for move scrollbar) OuterRect of Tables overlap what is placed on his right (cause issue for move scrollbar) Jan 9, 2021
@ocornut
Copy link
Owner

ocornut commented Jan 9, 2021

Thank you. That’s definitely a bug with how scrolling tables declare their outer size to the layout system. Should be an easy fix.

@ocornut ocornut added the layout label Jan 11, 2021
ocornut added a commit that referenced this issue Jan 11, 2021
@ocornut
Copy link
Owner

ocornut commented Jan 11, 2021

Fixed by not overwriting outer_window->DC.CursorPosPrevLine.x when using a child window (was previously checking ScrollX only). I made some other tweaks and comments to that code which ultimately should be moved to the layout system.

Thank you for the report.!

@aiekick
Copy link
Contributor Author

aiekick commented Jan 14, 2021

Can this fix, be merged in docking too please ? thanks :)

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