33
33
#include " core/config/project_settings.h"
34
34
#include " core/string/print_string.h"
35
35
#include " core/string/translation.h"
36
+ #include " scene/gui/container.h"
36
37
#include " scene/theme/theme_db.h"
37
38
#include " servers/text_server.h"
38
39
@@ -44,6 +45,7 @@ void Label::set_autowrap_mode(TextServer::AutowrapMode p_mode) {
44
45
autowrap_mode = p_mode;
45
46
lines_dirty = true ;
46
47
queue_redraw ();
48
+ update_configuration_warnings ();
47
49
48
50
if (clip || overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) {
49
51
update_minimum_size ();
@@ -327,6 +329,19 @@ inline void draw_glyph_outline(const Glyph &p_gl, const RID &p_canvas, const Col
327
329
PackedStringArray Label::get_configuration_warnings () const {
328
330
PackedStringArray warnings = Control::get_configuration_warnings ();
329
331
332
+ // FIXME: This is not ideal and the sizing model should be fixed,
333
+ // but for now we have to warn about this impossible to resolve combination.
334
+ // See GH-83546.
335
+ if (is_inside_tree () && get_tree ()->get_edited_scene_root () != this ) {
336
+ // If the Label happens to be the root node of the edited scene, we don't need
337
+ // to check what its parent is. It's going to be some node from the editor tree
338
+ // and it can be a container, but that makes no difference to the user.
339
+ Container *parent_container = Object::cast_to<Container>(get_parent_control ());
340
+ if (parent_container && autowrap_mode != TextServer::AUTOWRAP_OFF && get_custom_minimum_size () == Size2 ()) {
341
+ warnings.push_back (RTR (" Labels with autowrapping enabled must have a custom minimum size configured to work correctly inside a container." ));
342
+ }
343
+ }
344
+
330
345
// Ensure that the font can render all of the required glyphs.
331
346
Ref<Font> font;
332
347
if (settings.is_valid ()) {
0 commit comments