Make minimum drag distance configurable for gui elements#110245
Merged
Repiteo merged 1 commit intogodotengine:masterfrom Oct 27, 2025
Armynator:add-min-gui-drag-distance
Merged
Make minimum drag distance configurable for gui elements#110245Repiteo merged 1 commit intogodotengine:masterfrom Armynator:add-min-gui-drag-distance
Repiteo merged 1 commit intogodotengine:masterfrom
Armynator:add-min-gui-drag-distance
Conversation
Contributor
|
this is fantastic UX work! i’d love to get this approved. |
bruvzg
reviewed
Sep 4, 2025
Member
There was a problem hiding this comment.
Looks like a good UI improvement.
I think making it a Viewport property would be more convenient, the project setting still can be used for default viewport, add set here:
Lines 4475 to 4476 in 6c9aa4c
Contributor
Author
TY for pointing me there! I've done as you recommended now as it indeed has some advantages:
|
bruvzg
approved these changes
Sep 4, 2025
Contributor
|
Could you rebase your PR? See our pull request guidelines for more information |
Contributor
|
Thanks! Congratulations on your first merged contribution! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The minimum mouse drag distance for gui elements is currently hardcoded to 10, making it feel quite unresponsive to me. In Unity it's 5 by default and can be configured. Today I've learned that I'm not the only one having issues with it, making me wonder if there was a reason to hardcode it in the first place?
This PR turns it into a project setting, keeping the default value at 10. Also it's only used when running the game, so the editor behavior doesn't change even when adjusting the value.
It might be more useful to make this configurable per-viewport, but this version seems easier to use and understand.
(In Unity it's set in the EventSystem class (pixelDragThreshold), which usually only exists once in the scene as well)
In my specific case it allows me to use a TabBar also as a drag panel header for a scripted game window without feeling unresponsive
Default behavior (drag distance 10, window drag script distance 6):
drag_10.webm
(The window gets dragged for a moment as the NOTIFICATION_DRAG_BEGIN isn't fired by the TabBar yet)
Setting minimum drag distance to 5 (window drag script distance still 6):
drag_5.webm
(NOTIFICATION_DRAG_BEGIN is fired sooner, blocking the window movement script until NOTIFICATION_DRAG_END)
And I assume there are more use cases for this, as you can do quite a few things with the integrated drag & drop system...