Set a default text for Control nodes (and Label3D) when created in the editor - #119020
Open
Calinou wants to merge 1 commit into
Open
Set a default text for Control nodes (and Label3D) when created in the editor#119020Calinou wants to merge 1 commit into
Calinou wants to merge 1 commit into
Conversation
Calinou
commented
Apr 27, 2026
Comment on lines
+3105
to
3110
| if (ms.width < 10) { | ||
| ms.width = 40; | ||
| } | ||
| if (ms.height < 4) { | ||
| if (ms.height < 10) { | ||
| ms.height = 40; | ||
| } |
Member
Author
There was a problem hiding this comment.
I've changed the size thresholds for default sizing as the current threshold of (4, 4) didn't catch nodes like TextEdit. I assume this occurs because the current values were set a long time ago, when the default project theme was targeting lower resolutions than today.
Calinou
force-pushed
the
editor-control-default-text-size
branch
from
April 27, 2026 23:30
e402b2d to
96f0a45
Compare
Calinou
force-pushed
the
editor-control-default-text-size
branch
from
April 27, 2026 23:30
96f0a45 to
5a57cfe
Compare
KoBeWi
reviewed
Apr 28, 2026
| Control *control = Object::cast_to<Control>(p_child); | ||
| if (control) { | ||
| // Set default text to give immediate visual feedback when creating controls in the editor. | ||
| if (Object::cast_to<ColorPickerButton>(control)) { |
Member
There was a problem hiding this comment.
This should be
Suggested change
| if (Object::cast_to<ColorPickerButton>(control)) { | |
| ColorPickerButton *color_picker_button = Object::cast_to<ColorPickerButton>(control); | |
| if (color_picker_button) { |
Then you can use the setter directly instead of using set().
EDIT:
Just like you did for Label3D...
Member
Author
There was a problem hiding this comment.
There are a lot of controls with text or title properties, so I'd need to check for them individually if I wanted to use a typed approach.
…e editor This allows for immediate visual feedback when adding Control nodes in the editor. A minimum size is also set for controls that don't resize according to their text, so that the text can be displayed without wrapping, even when placed in a Container. For compatibility, this does not affect nodes created through code (in a `@tool` script or otherwise).
Calinou
force-pushed
the
editor-control-default-text-size
branch
from
April 28, 2026 15:53
5a57cfe to
46c460d
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows for immediate visual feedback when adding Control nodes in the editor. A minimum size is also set for controls that don't resize according to their text, so that the text can be displayed without wrapping, even when placed in a Container.
For compatibility, this does not affect nodes created through code (in a
@toolscript or otherwise).Preview
Top: nodes added in
masterin an HBoxContainer. (The first node is a ColorPickerButton.)Bottom: nodes added in this PR in an HBoxContainer.
TODO