1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Add scroll hints to ScrollContainer and Tree

This commit is contained in:
Michael Alexsander
2025-11-06 23:01:16 -03:00
parent 9dd6c4dbac
commit 639e396d98
10 changed files with 282 additions and 16 deletions

View File

@@ -52,6 +52,10 @@
<member name="scroll_deadzone" type="int" setter="set_deadzone" getter="get_deadzone" default="0">
Deadzone for touch scrolling. Lower deadzone makes the scrolling more sensitive.
</member>
<member name="scroll_hint_mode" type="int" setter="set_scroll_hint_mode" getter="get_scroll_hint_mode" enum="ScrollContainer.ScrollHintMode" default="0">
The way which scroll hints (indicators that show that the content can still be scrolled in a certain direction) will be shown.
[b]Note:[/b] Hints won't be shown if the content can be scrolled both vertically and horizontally.
</member>
<member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
The current horizontal scroll value.
[b]Note:[/b] If you are setting this value in the [method Node._ready] function or earlier, it needs to be wrapped with [method Object.set_deferred], since scroll bar's [member Range.max_value] is not initialized yet.
@@ -74,6 +78,9 @@
<member name="scroll_vertical_custom_step" type="float" setter="set_vertical_custom_step" getter="get_vertical_custom_step" default="-1.0">
Overrides the [member ScrollBar.custom_step] used when clicking the internal scroll bar's vertical increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused.
</member>
<member name="tile_scroll_hint" type="bool" setter="set_tile_scroll_hint" getter="is_scroll_hint_tiled" default="false">
If [code]true[/code], the scroll hint texture will be tiled instead of stretched. See [member scroll_hint_mode].
</member>
<member name="vertical_scroll_mode" type="int" setter="set_vertical_scroll_mode" getter="get_vertical_scroll_mode" enum="ScrollContainer.ScrollMode" default="1">
Controls whether vertical scrollbar can be used and when it should be visible.
</member>
@@ -108,6 +115,18 @@
<constant name="SCROLL_MODE_RESERVE" value="4" enum="ScrollMode">
Combines [constant SCROLL_MODE_AUTO] and [constant SCROLL_MODE_SHOW_ALWAYS]. The scrollbar is only visible if necessary, but the content size is adjusted as if it was always visible. It's useful for ensuring that content size stays the same regardless if the scrollbar is visible.
</constant>
<constant name="SCROLL_HINT_MODE_DISABLED" value="0" enum="ScrollHintMode">
Scroll hints will never be shown.
</constant>
<constant name="SCROLL_HINT_MODE_ALL" value="1" enum="ScrollHintMode">
Scroll hints will be shown at the top and bottom (if vertical), or left and right (if horizontal).
</constant>
<constant name="SCROLL_HINT_MODE_TOP_AND_LEFT" value="2" enum="ScrollHintMode">
Scroll hints will be shown at the top (if vertical), or the left (if horizontal).
</constant>
<constant name="SCROLL_HINT_MODE_BOTTOM_AND_RIGHT" value="3" enum="ScrollHintMode">
Scroll hints will be shown at the bottom (if horizontal), or the right (if horizontal).
</constant>
</constants>
<theme_items>
<theme_item name="scrollbar_h_separation" data_type="constant" type="int" default="0">
@@ -116,6 +135,12 @@
<theme_item name="scrollbar_v_separation" data_type="constant" type="int" default="0">
The space between the ScrollContainer's horizontal scroll bar and its content, in pixels. No space will be added when the content's minimum size is larger than the ScrollContainer's size.
</theme_item>
<theme_item name="scroll_hint_horizontal" data_type="icon" type="Texture2D">
The indicator that will be shown when the content can still be scrolled horizontally. See [member scroll_hint_mode].
</theme_item>
<theme_item name="scroll_hint_vertical" data_type="icon" type="Texture2D">
The indicator that will be shown when the content can still be scrolled vertically. See [member scroll_hint_mode].
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
The focus border [StyleBox] of the [ScrollContainer]. Only used if [member draw_focus_border] is [code]true[/code].
</theme_item>