-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Widgets only disabled when mouse over it #6373
Comments
That seems quite unusual. Why would you want to do that? Do you expect the interaction to brutally stop? How can the user resume operation once it is disabled? You can use |
For context, it was the first idea I came up with to restrain the slider handle within a smaller range in relation to other sliders (the outer ranges shared for all of them). Later I linked the values instead of brutally stopping the interaction as you said. Not perfect as there is a frame delay when updating the values of sliders above. I thought or redrawing all to remove the latency but probably too complicated for a detail. Anyway, I brought up the fact that disabled widgets only stop interaction on mouse over for a more general discussion and documentation. I did not find a related issue, but now I found #3985 which seems related.
Overall I think being able to keep dragging disabled widgets is quite an edge case and probably not worth it if it adds performance, and definitely would not prioritize it either. Thanks your work! cheers |
I suppose in theory we could add optional "clamping" values in
I agree this is something to address in theory, but being overwhelmed with tasks I would tend to avoid over-designing and solving edge cases like this if it doesn't address a concrete issue. So for now I would ignore it, and we may get back to it in the future when someone has a concrete problem. If clarifying/fixing that alone would fix your problem I would do it, but I don't think it is the right solution to your problem:
And my question "How can the user resume operation once it is disabled?" is important and not fully answered here: if the intent it clamping, in your specific context you would surely want to allow the user to immediately click to move back in the opposite direction? Which the disabling solution wouldn't allow. |
That would be pretty nice for sliders that need to have the same context/scale but a different min/max. Should also fix the visual 1-frame latency I mentioned with the bottom slider moving the ones above. I would add an option to visually mark the real min/max within the range but that starts to sound like a custom widget. Probably similar to a range slider #76 but with a single value.
I think you are doing great managing your tasks and I agree with ignoring it for now :) Indeed I don't disable other regions of the menu based on some app state at the momment. About the theoretical clamping in
Thats totally true, the underlaying intention is clamping and the user should be able to move it in the other direction. So the proposed internal clamping values would be the real solution: the handle would stop there but the user would keep interacting with the widget. Feel free to rename the issue for more context or open a new one if you want to focus on the slider behavior, thanks a lot! |
Version/Branch of DearImGui:
Version: 1.89.2 WIP
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: open source QT backend https://github.com/seanchas116/qtimgui
Operating System: Windows 10
Full config info
My Issue/Question:
I was trying to cancel the user interaction with a slider whenever the value goes above a certain value. A quick hack I used was to disable the region for a frame the next frame. Probably there are better ways to do it with the API? Other option is to send a mouse up event from the backend I guess.
This worked fine but only whenever the cursor was over the widget on the disabled frame. A GIF for context:
Testing out a bit more I found that the user can keep interacting with disabled widgets in general as long as they are not touched. Just wanted to point it out as I did not find any comment about it.
Thanks for the lib!
Screenshots/Video
Standalone, minimal, complete and verifiable example: (see #2261)
The text was updated successfully, but these errors were encountered: