From 11a5ed508b1cbde61a4d9dd4f469e86e74667623 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 21 Sep 2014 01:43:42 -0300 Subject: Fixed too many little issues, check the issues closed today. --- scene/gui/line_edit.cpp | 3 ++- scene/gui/text_edit.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++----- scene/gui/tree.cpp | 9 ++++++--- 3 files changed, 51 insertions(+), 9 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index e822cfef13..a77a40327f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -212,7 +212,7 @@ void LineEdit::_input_event(InputEvent p_event) { emit_signal( "text_entered",text ); // notify to hide soft keyboard - notification(NOTIFICATION_FOCUS_EXIT); + notification(NOTIFICATION_FOCUS_EXIT); return; } break; @@ -677,6 +677,7 @@ void LineEdit::selection_delete() { undo_text = text; text.erase(selection.begin,selection.end-selection.begin); + cursor_pos-=CLAMP( cursor_pos-selection.begin, 0, selection.end-selection.begin); if (cursor_pos>=text.length()) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 4095ddeb37..5934aaf126 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2611,20 +2611,53 @@ bool TextEdit::search(const String &p_key,uint32_t p_search_flags, int p_from_li int line=-1; int pos=-1; + line=p_from_line; + for(int i=0;iget_offset(); pos.y-=_get_title_button_height(); if (pos.y<0) return Control::get_tooltip(p_pos); - pos.x+=h_scroll->get_val(); - pos.y+=v_scroll->get_val(); + if (h_scroll->is_visible()) + pos.x+=h_scroll->get_val(); + if (v_scroll->is_visible()) + pos.y+=v_scroll->get_val(); int col,h; TreeItem *it = _find_item_at_pos(root,pos,col,h); - if (it) { + if (it) { String ret; if (it->get_tooltip(col)=="") -- cgit v1.2.3