wisp-forest / owo-lib

Open ωorthωhile Operations, yes the acronym was "totally accidental"
https://modrinth.com/mod/owo-lib
MIT License
191 stars 37 forks source link

[Suggestion] [owo-ui] Add scrollable text in case it doesn't fit in #220

Open Zailer43 opened 7 months ago

Zailer43 commented 7 months ago

Description

It would be good for owo-lib to support ClickableWidget.drawScrollableText. This is useful in case the component has a certain width and exceeds it. This can happen in situations like parameters (for example, if it's an item and they use Waxed Exposed Cut Copper Stairs, clearly you're not going to change the size just for this specific case) or translations

ButtonComponent

currently, if a horizontal sizing is not specified, the content sizing adjusts to the text. If a horizontal sizing is set and it exceeds it, the text overflows the button. In contrast, vanilla in recent versions uses ClickableWidget.drawScrollableText, you can see it on some buttons if you change the language (for example, Spanish in the accessibility screen)

LabelComponent

currently, if a horizontal sizing is not specified, the content sizing adjusts to the label. If a horizontal sizing is set, and in case it exceeds it, it breaks into multiple lines. It would be nice to have an option that requires a horizontal sizing and uses ClickableWidget.drawScrollableText

OwoUIDrawContext

perhaps it would be good to add OwoUIDrawContext.drawScrollableText? In case someone needs to use it and thus avoids having to use an access widener