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

[ScrollContainer] Expose horizontal/vertical custom_step of internal HScrollBar and VScrollBar. #6038

Closed
Maran23 opened this issue Jan 3, 2023 · 0 comments · Fixed by godotengine/godot#70868
Milestone

Comments

@Maran23
Copy link

Maran23 commented Jan 3, 2023

Describe the project you are working on

A game with a lot of UI and a heavily modified theme.
E.g. ScrollBars always have an increment and decrement button.
image

Describe the problem or limitation you are having in your project

Currently the ScrollContainer does not expose the custom_step property of their internal HScrollBar and VScrollBar.
image

Because of this, the increment and decrement buttons do no work, as they rely on a custom_step beeing set to a value > 0 (default is -1).
image

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Expose the horizontal/vertical custom_step of the internal HScrollBar and VScrollBar to the editor and thus allowing to easily set the values and make the increment and decrement buttons work.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Expose the horizontal/vertical custom_step of the corresponding HScrollBar and VScrollBar to the editor.
image

If this enhancement will not be used often, can it be worked around with a few lines of script?

One can write a custom ScrollContainer.
But since custom_step is already exposed to normal ScrollBars, I don't see why the ScrollContainer shouldn`t.

extends ScrollContainer

@export var custom_step_vertical: float = -1
@export var custom_step_horizontal: float = 1-

func _ready() -> void:
	get_v_scrollbar().custom_step = custom_step_vertical
	get_h_scrollbar().custom_step = custom_step_horizontal

Is there a reason why this should be core and not an add-on in the asset library?

ScrollContainer is a core component and custom_step is already exposed to normal ScrollBars.

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

Successfully merging a pull request may close this issue.

3 participants