Closed SpyrexDE closed 1 year ago
I think it might be OK by setting the mouse filter of rich text label to STOP. BTW, I suggest delete "remove_mouse_filter" in _ready() function, giving back the right to let users control it.
@HaroldLever You are right and it would be nice to allow the user to choose if the input should stop on the element or be passed to the scroll container. However, I chose this workaround because all Controls' mouse filters are "stop" by default. So when someone would just drag their label into the scroll container they won't be able to scroll using touch controls unless they figure out they have to set the right mouse filters. Do you have any idea on how to set the default filter for all children controls to "pass" while still allowing some to be specifically "stop?"
I do have an idea.
get_tree().node_added.connect(node_added)
in _ready()if Engine.is_editor_hint(): return
at first line of _process()func node_added(node): if node is Control and Engine.is_editor_hint(): if is_ancestor_of(node): node.mouse_filter = Control.MOUSE_FILTER_PASS
It would set PASS the default filter in EDITOR mode once a new child added to the container. You can delete "and Engine.is_editor_hint()" in node_added() if you want it work in GAME mode. (Not recommended)
@HaroldLever That's a great idea, I will implement it soon. Thank you!
In contrast to the native scroll container, the Smoothscroll container does not allow for passing drag input to its children:
https://github.com/SpyrexDE/SmoothScroll/assets/57133330/6b3f20c4-b088-43b4-9a73-30527d9cb302