Change Width of Scrollbar in RichTextLabel

4.4.1

I’m trying to create a custom (vertical) scrollbar inside of a RichTextLabel, and am running into some issues. I have set custom textures for the grabber and scroll fields in my theme, and now need to change the width of them to be larger. I have seen older suggestions that you should use the “Expand Margins” option to do this. This appears to work, however when I do it, the grabber stops recognizing mouse click input (ie. I can’t grab it) Using the mouse’s scrollwheel still works.

Another solution I have found is to use something like this in a script:

%RenderedPage.get_v_scroll_bar().rect_min_size.x = 50

When I try to, I get the error:

Invalid access to property or key 'rect_min_size' on a base object of type 'VScrollBar'.

Looking at the VScrollbar documentation, I don’t see any size options. Unless I am missing something, I assume this doesn’t exist in Godot 4.4.

Is there some other way to change the width of my scrollbar?

Perhaps %RenderedPage.get_v_scroll_bar().custom_minimum_size.x = 50.0 ?

This is exactly it! Thank you so much.

1 Like

It’s worth noting that the mouseover tooltips for properties in the inspector panel include the name you need to access properties from code.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.