A contextual button and shortcut to resize selected TextEdit and RichTextLabel nodes based on their content. It should only show if you have one or more TextEdit or RichTextLabel node(s) selected, and update all selected nodes at once.
[ ] Shortcut support (Ctrl R for refresh/resize?)
[ ] Undo support
[ ] RichTextLabel support
[ ] TextEdit support (for code examples)
It doesn't work in real-time
I tried to hook onto the engine's setters, and I tried adding an extra property to force the node to resize upon setting the text, but the result is buggy. It seems get_content_size doesn't get computed instantly on RichTextLabel
There may be a way to hack realtime resize into TextEdit etc. but I don't think it's worth the work to just save a keystroke. If you make resizing a manual operation, you can use get_content_size as-is. So for this first iteration, a button and keyboard shortcut will do the trick.
Just to make sure I got it, the desired behavior is to mimic Label's when we have Label.clip_text = false ? Will there be a limit for its width and/or height?
A contextual button and shortcut to resize selected TextEdit and RichTextLabel nodes based on their content. It should only show if you have one or more TextEdit or RichTextLabel node(s) selected, and update all selected nodes at once.
It doesn't work in real-time
I tried to hook onto the engine's setters, and I tried adding an extra property to force the node to resize upon setting the text, but the result is buggy. It seems
get_content_size
doesn't get computed instantly on RichTextLabelThere may be a way to hack realtime resize into TextEdit etc. but I don't think it's worth the work to just save a keystroke. If you make resizing a manual operation, you can use
get_content_size
as-is. So for this first iteration, a button and keyboard shortcut will do the trick.