Skip to content

Allow ScrollBar to watch ScrollContainer in tree #63626

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Jul 29, 2022

The ScrollBar is allowed to watch the ScrollContainer if both are in the tree.
That is, according to the orientation of this ScrollBar, the corresponding ScrollBar in the ScrollContainer is shared with this ScrollBar.

This patch will make it easy to replace the internal ScrollBar of the target ScrollContainer in the editor:

  1. Set the corresponding *_scroll_mode in ScrollContainer to SCROLL_MODE_SHOW_NEVER; (Scrolling is not available and will be fixed by Use more reasonable scrollable conditions in ScrollContainer #63562.)
  2. Add an extra ScrollBar and set its watch_target_path to the path of the target ScrollContainer.
Peek.2022-07-29.21-38.mp4

Close godotengine/godot-proposals#5012

@Rindbee Rindbee requested review from a team as code owners July 29, 2022 13:43
This `ScrollBar` is allowed to watch the `ScrollContainer` if both are in the tree.
That is, according to the `orientation` of this `ScrollBar`, the corresponding `ScrollBar` in the `ScrollContainer` is shared with this `ScrollBar`.

This patch will make it easy to replace the `ScrollBar` inside the `ScrollContainer` in the editor:
1. Set the corresponding `*_scroll_mode` in `ScrollContainer` to `SCROLL_MODE_SHOW_NEVER`;
2. Add an extra `ScrollBar` and set its `watch_target_path` to the path of the target `ScrollContainer`.
@Rindbee Rindbee force-pushed the allow-ScrollBar-to-watch-ScrollContainer-in-tree branch from 16d5a3c to 354722d Compare July 29, 2022 14:11
@YuriSizov
Copy link
Contributor

Something like this needs a proposal first to see if this is indeed an issue that many need fixing, and if this is indeed the solution that would be the best for the issue.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 17, 2022

Implementation looks ok, but I wonder if this really should be inside ScrollBar. It looks like something that should be in ScrollContainer. But then it would become more complex, idk 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow ScrollBar to watch ScrollContainer in tree
3 participants