Merge pull request #111744 from bruvzg/te_roff

[TextEdit] Make `wrap_right_offset` adjustable theme constant.
This commit is contained in:
Thaddeus Crews
2025-10-21 10:26:53 -05:00
4 changed files with 7 additions and 2 deletions

View File

@@ -7645,6 +7645,7 @@ void TextEdit::_bind_methods() {
BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_COLOR, TextEdit, outline_color, "font_outline_color");
BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, TextEdit, line_spacing);
BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, TextEdit, wrap_offset);
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, TextEdit, background_color);
BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, TextEdit, current_line_color);
@@ -8529,7 +8530,7 @@ void TextEdit::_update_wrap_at_column(bool p_force) {
new_wrap_at -= v_scroll->get_combined_minimum_size().width;
}
/* Give it a little more space. */
new_wrap_at -= wrap_right_offset;
new_wrap_at -= theme_cache.wrap_offset;
if ((wrap_at_column != new_wrap_at) || p_force) {
wrap_at_column = new_wrap_at;

View File

@@ -527,7 +527,6 @@ private:
TextServer::AutowrapMode autowrap_mode = TextServer::AUTOWRAP_WORD_SMART;
int wrap_at_column = 0;
int wrap_right_offset = 10;
void _update_wrap_at_column(bool p_force = false);
@@ -641,6 +640,7 @@ private:
Color outline_color = Color(1, 1, 1);
int line_spacing = 1;
int wrap_offset = 10;
Color background_color = Color(1, 1, 1);
Color current_line_color = Color(1, 1, 1);