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

Combo drop down list shortened when close to the bottom of ImGui display #505

Closed
YukinoHayakawa opened this issue Jan 25, 2016 · 5 comments
Labels

Comments

@YukinoHayakawa
Copy link

Especially when the combo is the last widget of a gui window, I see no way to access it except moving the window which is not very convenient.
Maybe a minimum height should be set and align its bottom to sys window like hover tips of graphs do.
image

@ocornut
Copy link
Owner

ocornut commented Jan 25, 2016

So the issue isn't about "the last widget of a gui window" but the fact that the combo popup is clipped by your display size, not by any window size. I would need to alter the positioning accordingly to move the popup over the combo when possible. It's usually a little tricky to handle all corners cases with small windows.

@YukinoHayakawa
Copy link
Author

Well I was confused with these two sizes then. What I wanted to say is that when a combo is

  • the last widget in a window
  • very close to the bottom of the window

and

  • the bottom of the window is very close to rendering window

I'll have to move the windows in order to use the combo because there is no more space to scroll down anymore.
Anyway, an improvement on this would be great.

@ocornut
Copy link
Owner

ocornut commented Jan 26, 2016

Which can be shortened as:

  • When a combo is close to the bottom of the rendering window

I don't know when I'll be able to look into it, will do eventually.

@ocornut ocornut changed the title the drop down list of a Combo is very short / can't be seen at all when the Combo is near the bottom of system windows Combo drop down list shortened when close to the bottom of ImGui display Jan 26, 2016
@ocornut ocornut added the bug label Jan 26, 2016
@texisthelex
Copy link

I've fixed this problem adding this code after line 8052 in imgui.cpp:

        // If the rectangle goes below the DisplaySize
        if (popup_rect.Max.y > g.IO.DisplaySize.y)
        {
            float delta = popup_rect.Max.y - g.IO.DisplaySize.y;
            popup_rect = ImRect(ImVec2(frame_bb.Min.x, frame_bb.Max.y - delta), ImVec2(frame_bb.Max.x, frame_bb.Max.y + popup_height - delta));
        }

ocornut added a commit that referenced this issue Mar 25, 2016
@ocornut
Copy link
Owner

ocornut commented Mar 25, 2016

@texisthelex That would be ok but it overlaps the main widget.
I have now made it that the combo move above the widget if there's not enough space below AND there's more space above than below. It should be ok in most cases (tried a few difference cases) and never overlap the parent widget.

@ocornut ocornut closed this as completed Mar 25, 2016
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

3 participants