diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-04-11 23:21:48 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-04-11 23:23:24 -0300 |
commit | 9f4b5a91c054a538bd5d3581200c56473140f390 (patch) | |
tree | e44fb72d677090b805f14b9d485d4616c86827bb /scene/gui | |
parent | da65d546491f11aebf0427f08c826eea3c9e7efb (diff) |
Reorganized connection dialog for much improved ease of use.
-Removed dest path field
-Added a "Source" signal
-Added an "Advanced" button to hide complexity
-Fix bug on Tree to make sure "ensure visible" works on hidden trees
-Fix bug on TextEdit to ensure signals created with script not open sill focus the right line
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 7 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 9acf8d40c9..39a0b0aaf2 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -590,6 +590,12 @@ void TextEdit::_notification(int p_what) { } } break; case NOTIFICATION_DRAW: { + + if (first_draw) { + //size may not be the final one, so attempts to ensure cursor was visible may have failed + adjust_viewport_to_cursor(); + first_draw = false; + } Size2 size = get_size(); if ((!has_focus() && !menu->has_focus()) || !window_has_focus) { draw_caret = false; @@ -6356,6 +6362,7 @@ TextEdit::TextEdit() { menu->add_item(RTR("Undo"), MENU_UNDO, KEY_MASK_CMD | KEY_Z); menu->add_item(RTR("Redo"), MENU_REDO, KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z); menu->connect("id_pressed", this, "menu_option"); + first_draw = true; } TextEdit::~TextEdit() { diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 33f0a3f45d..96b409c6d4 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -275,6 +275,7 @@ private: int wrap_at; int wrap_right_offset; + bool first_draw; bool setting_row; bool draw_tabs; bool override_selected_font_color; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 7f00e7bd24..92f7d6b588 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3388,10 +3388,13 @@ void Tree::ensure_cursor_is_visible() { int h = compute_item_height(selected) + cache.vseparation; int screenh = get_size().height - h_scroll->get_combined_minimum_size().height; - if (ofs + h > v_scroll->get_value() + screenh) + if (h > screenh) { //screen size is too small, maybe it was not resized yet. + v_scroll->set_value(ofs); + } else if (ofs + h > v_scroll->get_value() + screenh) { v_scroll->call_deferred("set_value", ofs - screenh + h); - else if (ofs < v_scroll->get_value()) + } else if (ofs < v_scroll->get_value()) { v_scroll->set_value(ofs); + } } int Tree::get_pressed_button() const { |