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

Can default scrolling behavior via mouse wheel be set to horizontal? #8060

Open
alektron opened this issue Oct 14, 2024 · 1 comment
Open

Comments

@alektron
Copy link
Contributor

Version/Branch of Dear ImGui:

Version 1.91.4, Branch: docking

Back-ends:

Backend independent (might only be relevant for Windows, see note below)

Compiler, OS:

Visual Studio 2022 MSVC C++ 20

Full config/build information:

No response

Details:

I have a (child) window that can only scroll horizontally via the mouse wheel.
The content size is smaller than the window size on the y axis, so no vertical scrolling is possible.
The content size is bigger than the window size on the x axis, so horizontal scrolling is possible.
The scrollbar is hidden via the ImGuiWindowFlags_NoScrollbar flag but it might just as well be visible. It should not really matter for the question.

With this configuration it is possible to scroll horizontally with the mouse wheel by holding shift.
However, since this window in my scenario will never scroll vertically I would like that to be the default behavior (without shift).
Is that currently possible with some combination of flags or do I have set ScrollX myself programatically?

Note:
There seem to be some differences in the scrolling behavior if ConfigMacOSXBehaviors is set. Maybe that would even do what I need? I'm not a MacOS user so I could not tell but since I am on Windows I would probably prefer not to set that flag either way.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

@ocornut ocornut changed the title [Question] Can default scrolling behavior via mouse wheel be set to horizontal? Can default scrolling behavior via mouse wheel be set to horizontal? Oct 14, 2024
@ocornut
Copy link
Owner

ocornut commented Oct 14, 2024

It doesn't seem to be easily possible right now but it would be a good idea to allow for it.

My problem is at which point to fit that in the API.

The scrolling/scrollbar related flags in ImGuiWindowFlags seems already a bit polluting, I wish we had a better design.

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