@@ -110,32 +110,32 @@ Ref<FoldableGroup> FoldableContainer::get_foldable_group() const {
110
110
return foldable_group;
111
111
}
112
112
113
- void FoldableContainer::set_text (const String &p_text) {
114
- if (text == p_text) {
113
+ void FoldableContainer::set_title (const String &p_text) {
114
+ if (title == p_text) {
115
115
return ;
116
116
}
117
- text = p_text;
117
+ title = p_text;
118
118
_shape ();
119
119
update_minimum_size ();
120
120
queue_redraw ();
121
121
}
122
122
123
- String FoldableContainer::get_text () const {
124
- return text ;
123
+ String FoldableContainer::get_title () const {
124
+ return title ;
125
125
}
126
126
127
- void FoldableContainer::set_text_alignment (HorizontalAlignment p_alignment) {
127
+ void FoldableContainer::set_title_alignment (HorizontalAlignment p_alignment) {
128
128
ERR_FAIL_INDEX ((int )p_alignment, 3 );
129
- text_alignment = p_alignment;
129
+ title_alignment = p_alignment;
130
130
131
131
if (_get_actual_alignment () != text_buf->get_horizontal_alignment ()) {
132
132
_shape ();
133
133
queue_redraw ();
134
134
}
135
135
}
136
136
137
- HorizontalAlignment FoldableContainer::get_text_alignment () const {
138
- return text_alignment ;
137
+ HorizontalAlignment FoldableContainer::get_title_alignment () const {
138
+ return title_alignment ;
139
139
}
140
140
141
141
void FoldableContainer::set_language (const String &p_language) {
@@ -152,21 +152,21 @@ String FoldableContainer::get_language() const {
152
152
return language;
153
153
}
154
154
155
- void FoldableContainer::set_text_direction (TextDirection p_text_direction) {
155
+ void FoldableContainer::set_title_text_direction (TextDirection p_text_direction) {
156
156
ERR_FAIL_INDEX (int (p_text_direction), 4 );
157
- if (text_direction == p_text_direction) {
157
+ if (title_text_direction == p_text_direction) {
158
158
return ;
159
159
}
160
- text_direction = p_text_direction;
160
+ title_text_direction = p_text_direction;
161
161
_shape ();
162
162
queue_redraw ();
163
163
}
164
164
165
- Control::TextDirection FoldableContainer::get_text_direction () const {
166
- return text_direction ;
165
+ Control::TextDirection FoldableContainer::get_title_text_direction () const {
166
+ return title_text_direction ;
167
167
}
168
168
169
- void FoldableContainer::set_text_overrun_behavior (TextServer::OverrunBehavior p_overrun_behavior) {
169
+ void FoldableContainer::set_title_text_overrun_behavior (TextServer::OverrunBehavior p_overrun_behavior) {
170
170
if (overrun_behavior == p_overrun_behavior) {
171
171
return ;
172
172
}
@@ -176,7 +176,7 @@ void FoldableContainer::set_text_overrun_behavior(TextServer::OverrunBehavior p_
176
176
queue_redraw ();
177
177
}
178
178
179
- TextServer::OverrunBehavior FoldableContainer::get_text_overrun_behavior () const {
179
+ TextServer::OverrunBehavior FoldableContainer::get_title_text_overrun_behavior () const {
180
180
return overrun_behavior;
181
181
}
182
182
@@ -440,7 +440,7 @@ void FoldableContainer::_update_title_min_size() const {
440
440
title_minimum_size = title_ms;
441
441
title_minimum_size.width += icon->get_width ();
442
442
443
- if (!text .is_empty ()) {
443
+ if (!title .is_empty ()) {
444
444
title_minimum_size.width += h_separation;
445
445
Size2 text_size = text_buf->get_size ();
446
446
title_minimum_size.height += MAX (text_size.height , icon->get_height ());
@@ -481,25 +481,25 @@ void FoldableContainer::_shape() {
481
481
text_buf->clear ();
482
482
text_buf->set_width (-1 );
483
483
484
- if (text_direction == TEXT_DIRECTION_INHERITED) {
484
+ if (title_text_direction == TEXT_DIRECTION_INHERITED) {
485
485
text_buf->set_direction (is_layout_rtl () ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR);
486
486
} else {
487
- text_buf->set_direction ((TextServer::Direction)text_direction );
487
+ text_buf->set_direction ((TextServer::Direction)title_text_direction );
488
488
}
489
489
text_buf->set_horizontal_alignment (_get_actual_alignment ());
490
490
text_buf->set_text_overrun_behavior (overrun_behavior);
491
- text_buf->add_string (atr (text ), font, font_size, language);
491
+ text_buf->add_string (atr (title ), font, font_size, language);
492
492
}
493
493
494
494
HorizontalAlignment FoldableContainer::_get_actual_alignment () const {
495
495
if (is_layout_rtl ()) {
496
- if (text_alignment == HORIZONTAL_ALIGNMENT_RIGHT) {
496
+ if (title_alignment == HORIZONTAL_ALIGNMENT_RIGHT) {
497
497
return HORIZONTAL_ALIGNMENT_LEFT;
498
- } else if (text_alignment == HORIZONTAL_ALIGNMENT_LEFT) {
498
+ } else if (title_alignment == HORIZONTAL_ALIGNMENT_LEFT) {
499
499
return HORIZONTAL_ALIGNMENT_RIGHT;
500
500
}
501
501
}
502
- return text_alignment ;
502
+ return title_alignment ;
503
503
}
504
504
505
505
void FoldableContainer::_update_group () {
@@ -530,16 +530,16 @@ void FoldableContainer::_bind_methods() {
530
530
ClassDB::bind_method (D_METHOD (" is_folded" ), &FoldableContainer::is_folded);
531
531
ClassDB::bind_method (D_METHOD (" set_foldable_group" , " button_group" ), &FoldableContainer::set_foldable_group);
532
532
ClassDB::bind_method (D_METHOD (" get_foldable_group" ), &FoldableContainer::get_foldable_group);
533
- ClassDB::bind_method (D_METHOD (" set_text " , " text" ), &FoldableContainer::set_text );
534
- ClassDB::bind_method (D_METHOD (" get_text " ), &FoldableContainer::get_text );
535
- ClassDB::bind_method (D_METHOD (" set_title_alignment" , " alignment" ), &FoldableContainer::set_text_alignment );
536
- ClassDB::bind_method (D_METHOD (" get_title_alignment" ), &FoldableContainer::get_text_alignment );
533
+ ClassDB::bind_method (D_METHOD (" set_title " , " text" ), &FoldableContainer::set_title );
534
+ ClassDB::bind_method (D_METHOD (" get_title " ), &FoldableContainer::get_title );
535
+ ClassDB::bind_method (D_METHOD (" set_title_alignment" , " alignment" ), &FoldableContainer::set_title_alignment );
536
+ ClassDB::bind_method (D_METHOD (" get_title_alignment" ), &FoldableContainer::get_title_alignment );
537
537
ClassDB::bind_method (D_METHOD (" set_language" , " language" ), &FoldableContainer::set_language);
538
538
ClassDB::bind_method (D_METHOD (" get_language" ), &FoldableContainer::get_language);
539
- ClassDB::bind_method (D_METHOD (" set_text_direction " , " text_direction" ), &FoldableContainer::set_text_direction );
540
- ClassDB::bind_method (D_METHOD (" get_text_direction " ), &FoldableContainer::get_text_direction );
541
- ClassDB::bind_method (D_METHOD (" set_text_overrun_behavior " , " overrun_behavior" ), &FoldableContainer::set_text_overrun_behavior );
542
- ClassDB::bind_method (D_METHOD (" get_text_overrun_behavior " ), &FoldableContainer::get_text_overrun_behavior );
539
+ ClassDB::bind_method (D_METHOD (" set_title_text_direction " , " text_direction" ), &FoldableContainer::set_title_text_direction );
540
+ ClassDB::bind_method (D_METHOD (" get_title_text_direction " ), &FoldableContainer::get_title_text_direction );
541
+ ClassDB::bind_method (D_METHOD (" set_title_text_overrun_behavior " , " overrun_behavior" ), &FoldableContainer::set_title_text_overrun_behavior );
542
+ ClassDB::bind_method (D_METHOD (" get_title_text_overrun_behavior " ), &FoldableContainer::get_title_text_overrun_behavior );
543
543
ClassDB::bind_method (D_METHOD (" set_title_position" , " title_position" ), &FoldableContainer::set_title_position);
544
544
ClassDB::bind_method (D_METHOD (" get_title_position" ), &FoldableContainer::get_title_position);
545
545
ClassDB::bind_method (D_METHOD (" add_title_bar_control" , " control" ), &FoldableContainer::add_title_bar_control);
@@ -548,14 +548,14 @@ void FoldableContainer::_bind_methods() {
548
548
ADD_SIGNAL (MethodInfo (" folding_changed" , PropertyInfo (Variant::BOOL, " is_folded" )));
549
549
550
550
ADD_PROPERTY (PropertyInfo (Variant::BOOL, " folded" ), " set_folded" , " is_folded" );
551
- ADD_PROPERTY (PropertyInfo (Variant::STRING, " text " ), " set_text " , " get_text " );
551
+ ADD_PROPERTY (PropertyInfo (Variant::STRING, " title " ), " set_title " , " get_title " );
552
552
ADD_PROPERTY (PropertyInfo (Variant::INT, " title_alignment" , PROPERTY_HINT_ENUM, " Left,Center,Right" ), " set_title_alignment" , " get_title_alignment" );
553
553
ADD_PROPERTY (PropertyInfo (Variant::INT, " title_position" , PROPERTY_HINT_ENUM, " Top,Bottom" ), " set_title_position" , " get_title_position" );
554
- ADD_PROPERTY (PropertyInfo (Variant::INT, " text_overrun_behavior " , PROPERTY_HINT_ENUM, " Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis" ), " set_text_overrun_behavior " , " get_text_overrun_behavior " );
554
+ ADD_PROPERTY (PropertyInfo (Variant::INT, " title_text_overrun_behavior " , PROPERTY_HINT_ENUM, " Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis" ), " set_title_text_overrun_behavior " , " get_title_text_overrun_behavior " );
555
555
ADD_PROPERTY (PropertyInfo (Variant::OBJECT, " foldable_group" , PROPERTY_HINT_RESOURCE_TYPE, " FoldableGroup" ), " set_foldable_group" , " get_foldable_group" );
556
556
557
557
ADD_GROUP (" BiDi" , " " );
558
- ADD_PROPERTY (PropertyInfo (Variant::INT, " text_direction " , PROPERTY_HINT_ENUM, " Auto,Left-to-Right,Right-to-Left,Inherited" ), " set_text_direction " , " get_text_direction " );
558
+ ADD_PROPERTY (PropertyInfo (Variant::INT, " title_text_direction " , PROPERTY_HINT_ENUM, " Auto,Left-to-Right,Right-to-Left,Inherited" ), " set_title_text_direction " , " get_title_text_direction " );
559
559
ADD_PROPERTY (PropertyInfo (Variant::STRING, " language" , PROPERTY_HINT_LOCALE_ID), " set_language" , " get_language" );
560
560
561
561
BIND_ENUM_CONSTANT (POSITION_TOP);
@@ -587,7 +587,7 @@ void FoldableContainer::_bind_methods() {
587
587
588
588
FoldableContainer::FoldableContainer (const String &p_text) {
589
589
text_buf.instantiate ();
590
- set_text (p_text);
590
+ set_title (p_text);
591
591
set_focus_mode (FOCUS_ALL);
592
592
set_mouse_filter (MOUSE_FILTER_STOP);
593
593
}
0 commit comments