-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Placeholder to TextEdit #57100
Add Placeholder to TextEdit #57100
Conversation
@@ -867,11 +873,14 @@ void TextEdit::_notification(int p_what) { | |||
|
|||
// Ensure we at least use the font color. | |||
Color current_color = !editable ? font_readonly_color : font_color; | |||
if (draw_placeholder) { | |||
current_color.a *= placeholder_alpha; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to provide it as a dedicated theme color property (that can default to have 0.6 alpha).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same is used in the LineEdit
, so if it's moved to the theme, it should be done for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do that as a follow-up PR for LineEdit
and now TextEdit
too.
@@ -867,11 +873,14 @@ void TextEdit::_notification(int p_what) { | |||
|
|||
// Ensure we at least use the font color. | |||
Color current_color = !editable ? font_readonly_color : font_color; | |||
if (draw_placeholder) { | |||
current_color.a *= placeholder_alpha; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same is used in the LineEdit
, so if it's moved to the theme, it should be done for both.
Thanks! |
Is this backported? |
No, it needs to be redone from scratch in |
Adds a placeholder to
TextEdit
following the same naming scheme inLineEdit
. Supports wrapping, newlines and scrolling.Uses the same draw loop thanks to the
TextServer
abstractions, though does not appear on the minimap.closes godotengine/godot-proposals/issues/1995