-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Decorating scroll bars #3114
Comments
Hey @wolfpld, |
…tidying up code to make it more obvious how to draw over scrollbars. (#3114)
I have pushed a first change toward that: f7852fa
Using
EDIT If you don't use any ImGui:: interactive/function in the drawing, you can replace ImGui::PushClipRect/PopClipRect by the lower-level window->DrawList->PushClipRect() equivalent.
And then you have the render it yourself, which is a little bit awkward but not super complicated (and you don't necessarily need to match all edge cases behavior handled by ScrollbarEx).
I hope this is useful and I'd be interested in seeing that you can do with the above information. I'm happy to make further change or add more internal helpers. Don't hesitate to post your result or link to the code if you do end with something, even if you don't have explicit requests it may be helpful as a resources and I may still come up with improvements on our side of the fence. |
This everything I need. Usage example:
I will post a screenshot when I'm finished with everything I want to have here. Thanks. |
There are two kinds of information shown with scroll bar decorations on the screenshot below: |
I would like to add decorations to a (child) window scroll bar. Something alike to the following examples:
VTune (let's ignore that decorations are placed next to the scroll bar here):
MSVC:
I can't see anything in the API, which would allow doing so. I would imagine at least the following functions should be added:
A bit of thought is required to decide in which place user elements should be placed: before scroll bar is drawn, after scroll bar is drawn, or between drawing scroll background and scroll grab element. It may be best to expose all the possibilities through a parameter to
GetScrollDrawList()
, but to get things running quickly it seems reasonable to use the third option. This way user elements won't ever be obscuring the grab element.The text was updated successfully, but these errors were encountered: