-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Behavior of clicking in scrollbar #7328
Comments
I have reworked the scrollbar behavior as suggested, doing a page by page scroll when clicking outside the grab: 5cbc34a
That may be implemented on your end: if (ImGui::Shortcut(ImGuiMod_Ctrl | ImGuiKey_MouseWheelY))
{
float v = ImGui::GetKeyData(ImGuiKey_MouseWheelY)->AnalogValue;
ImGui::SetScrollY(ImGui::GetScrollY() + -v * ImGui::GetCurrentWindow()->InnerRect.GetHeight());
} HOWEVER, it won't work as expected/desired with OS and drivers emitting smooth scrolling values for wheel (such as OS X, and some mouse setups/drivers on Windows). |
Thanks! |
The main motivation for upgrading is: ocornut/imgui#7328 Thanks 'ocornut' for implementing this! After upgrading (to v1.90.7) we needed to adjust for some API changes: #1630 Thanks again 'ocornut' for the heads-up.
It's working great. Thanks! |
Version/Branch of Dear ImGui:
Version 1.90.3, Branch: docking
Back-ends:
imgui_impl_opengl3.cpp + imgui_impl_sdl2.cpp
Compiler, OS:
Linux + GCC 13
Full config/build information:
No response
Details:
Hi,
Applications typically react in one of two ways when clicking in a scrollbar:
Depending on the situation one or the other can be better.
For example in my application (using Dear ImGui) I have a debugger with a disassembly view. This view literally contains tens of thousands of instructions (thanks a lot for ImGuiListClipper!). Trying to accurately scroll in this view using the scrollbar is difficult. And therefor some of our users requested the alternative scrollbar behavior.
The current workaround (for positioning the view using the mouse) is to approximately scroll via clicking the scrollbar and then fine-tune via the scroll-wheel. Though that's not ideal. Allowing to scroll per-page with the mouse (like in firefox/chrome) would mitigate this problem.
My question: would it be possible to have this alternative behavior for ImGui scrollbars?
An orthogonal though related question:
Some application use CTRL+scroll-wheel to scroll per page instead of per line. Could that be added in Dear ImGui? Though this behavior seems less universal, some applications instead zoom in/out when using CTRL+scroll-wheel.
Thanks for considering this.
Wouter
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: