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

Add horizontal and vertical separation to ScrollContainer theme constants. #97245

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

Conversation

WhalesState
Copy link
Contributor

It's hard to make such separation in code, since the ScrollContainer doesn't provide signals to tell when the ScrollBar becomes visible or hidden, so this will save us from adding two extra dummy spacers which will also need an extra HBoxContainer and VBoxContainer and to show/hide the spacers when size is changed after checking if the HScrollBar or the VScrollBar is visible.

ScrollContainerSeparation.mp4

@WhalesState WhalesState requested review from a team as code owners September 20, 2024 18:57
@Mickeon Mickeon added this to the 4.x milestone Sep 20, 2024
@WhalesState
Copy link
Contributor Author

WhalesState commented Sep 20, 2024

100% safe.

The default is 0, for Compatibility 😄.

I also forgot to mention that it works fine for RTL layouts too.

image

Why?

Because we already can define a panel for ScrollContainer and we edit the content margin, it will look ugly if the scroll have a one side margin, but the other side can't be controlled.

image

@Giganzo
Copy link
Contributor

Giganzo commented Sep 21, 2024

would v_scroll_bar_separation and h_scroll_bar_separation be better names?

@WhalesState
Copy link
Contributor Author

WhalesState commented Sep 21, 2024

would v_scroll_bar_separation and h_scroll_bar_separation be better names?

Godot in general is using the words "separation", "h_separation" and "v_separation" for any similar kinds of separations.

For example button has "h_separation" not "h_text_separation" or "h_icon_separation".

Also this is easy to be achieved by binding a custom theme constant, but once it's merged and released, it will never be changed for compatibility.

@Giganzo
Copy link
Contributor

Giganzo commented Sep 21, 2024

Godot in general is using the words "separation", "h_separation" and "v_separation" for any similar kinds of separations.

There is also Tree that has scrollbar_v_separation. And from the description it sounds like it does same as this pr but for the Tree

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.

3 participants