Add horizontal and vertical separation to `ScrollContainer` theme constants.
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.
https://github.com/user-attachments/assets/ff2d9efa-575a-41ba-ac87-4722bacc720f
100% safe.
The default is 0, for Compatibility 😄.
I also forgot to mention that it works fine for RTL layouts too.
Why?
Because we already can define a panel for ScrollContainer and we edit the content margin, it will look ugly if the scroll has a one side margin, but the other side can't be controlled.
would v_scroll_bar_separation and h_scroll_bar_separation be better names?
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.
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
I have no issues with it's name, let's just wait until someone reviews it, and we will resolve this.
Needs rebase. There is new SCROLL_MODE_RESERVE that you need to take into account.
Rebased.
@Mickeon Probably another candidate for salvaging?
Yeah. But could use a proposal or general user interest first.