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

Scrolling by dragging on 'empty space'? #1689

Closed
nikki93 opened this issue Mar 20, 2018 · 4 comments
Closed

Scrolling by dragging on 'empty space'? #1689

nikki93 opened this issue Mar 20, 2018 · 4 comments

Comments

@nikki93
Copy link

nikki93 commented Mar 20, 2018

Hi! This is a great lib and it's been working well with just small integration code. :) I'm using it in an iPad / iPhone context and was wondering if it's possible to easily enable scrolling when a user clicks and drags in 'empty space' in the window? Sort of like how it happens on most mainstream UIs on iOS and Android these days.

In the demo window included with imgui it says, "Click and drag on any empty space to move window." -- I basically want this but instead of moving the parent window, to move the containing scroll region. Thanks! :)

@thedmd
Copy link
Contributor

thedmd commented Mar 20, 2018

You can use invisible button covering whole screen to grab input and handle dragging. Just remember to use it at very end of your UI.

Let me know if you need more clues.

@ocornut
Copy link
Owner

ocornut commented Mar 20, 2018

Now that we have ConfigFlags we could consider including that sort of feature as a global flag in the codebase. Perhaps it should be wired on two-fingers touches however, which we don't have a way to wire in at the moment.

@rg-net
Copy link

rg-net commented Dec 9, 2018

Mobile will do this on one finger. So if that is the main use case perhaps we should stay consistent to what the use probably expects...

@ocornut
Copy link
Owner

ocornut commented Aug 4, 2020

You can use invisible button covering whole screen to grab input and handle dragging. Just remember to use it at very end of your UI.

FYI I posted code to do #3379 to do this.
I'm closing this as it is essentially the same as #3379 so we can have the conversation in one spot. Will post in both threads if another solution/change is made.

@ocornut ocornut closed this as completed Aug 4, 2020
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

4 participants