From 9234bd3ff9a3ff025368a1882ccfb91ca1b96ff1 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Fri, 11 Mar 2016 18:10:01 +0000 Subject: Added configuable tab size --- scene/gui/text_edit.cpp | 7 +++++++ scene/gui/text_edit.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 32f4be5d17..503aa5de98 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3495,6 +3495,13 @@ void TextEdit::_push_current_op() { } +void TextEdit::set_tab_size(const int p_size) { + ERR_FAIL_COND(p_size <= 0); + tab_size = p_size; + text.set_tab_size(p_size); + update(); +} + void TextEdit::set_draw_tabs(bool p_draw) { draw_tabs=p_draw; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 2eff8e89c7..ac8136cd8b 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -378,7 +378,7 @@ public: void redo(); void clear_undo_history(); - + void set_tab_size(const int p_size); void set_draw_tabs(bool p_draw); bool is_drawing_tabs() const; -- cgit v1.2.3