Open AThousandShips opened 2 months ago
Is it possible to just "steal" the internal scroll bar from the control and reparent it somewhere else?
That wouldn't be recommended IMO, internal nodes should be left to the management of the parent, making the controls able to gracefully deal with that would make the code more complicated and fragile
Describe the project you are working on
N/A
Describe the problem or limitation you are having in your project
Control
s with scroll bars, likeRichTextLabel
,ScrollContainer
, etc. can be difficult to fully customize in some more elaborate UI designs, like having a smaller elaborate scroll bar on the size with some spacing from a scroll areaDescribe the feature / enhancement and how it helps to overcome the problem or limitation
Control
s would be able to "delegate" the scroll bar interface to an external scroll bar, which the user can place where ever they like, and design how ever they would likeDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Each
Control
that has some built-in scroll bar feature would be provided a new set of methods allowing you to provide your own scroll bar(s) that theControl
would use instead (with some checks to ensure they are still valid of course), theControl
would treat the layout of itself as if the scroll bar(s) were hidden and handle resizing based on that, it would then handle all the detail configuration of the scroll bar(s) directly (such as setting up the range and value of it when needed) but would not touch any theme details or other aspects (such as drawing ticks etc.)Optionally the provided interface could use a plain
Range
allowing a fully custom interface for drawing not relying on the standardScrollBar
system (though this would require substitutingscroll
andscroll_to
)If this enhancement will not be used often, can it be worked around with a few lines of script?
This can be generally worked around at least in some cases (with setting the scroll manually, or scrolling to a particular line, etc.) but it involves detecting various conditions when the scroll bars need to be updated (for example when the size of the container changes, or the size of the content changes, and the scroll bar range needs updating, etc.) so it's fragile and hard to accomplish
Is there a reason why this should be core and not an add-on in the asset library?
This would be a core feature of these
Control
s and replaces existing code