summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/color_picker.cpp1
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/gui/tree.cpp9
-rw-r--r--scene/gui/tree.h4
4 files changed, 15 insertions, 1 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 6c81ef0998..6c36db0c92 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -52,6 +52,7 @@ void ColorPicker::_notification(int p_what) {
btn_pick->set_icon(get_theme_icon("screen_picker", "ColorPicker"));
bt_add_preset->set_icon(get_theme_icon("add_preset"));
+ _update_controls();
_update_color();
#ifdef TOOLS_ENABLED
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 81c53708ab..9285314abe 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2296,7 +2296,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
int prev_col = cursor.column;
int prev_line = cursor.line;
- cursor_set_line(row, true, false);
+ cursor_set_line(row, false, false);
cursor_set_column(col);
if (mb->get_shift() && (cursor.column != prev_col || cursor.line != prev_line)) {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 0049b54f50..c21497a995 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -3322,6 +3322,14 @@ void Tree::item_selected(int p_column, TreeItem *p_item) {
}
void Tree::item_deselected(int p_column, TreeItem *p_item) {
+ if (selected_item == p_item) {
+ selected_item = nullptr;
+ }
+
+ if (selected_col == p_column) {
+ selected_col = -1;
+ }
+
if (select_mode == SELECT_MULTI || select_mode == SELECT_SINGLE) {
p_item->cells.write[p_column].selected = false;
}
@@ -4174,6 +4182,7 @@ void Tree::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_column_title_language", "column"), &Tree::get_column_title_language);
ClassDB::bind_method(D_METHOD("get_scroll"), &Tree::get_scroll);
+ ClassDB::bind_method(D_METHOD("scroll_to_item", "item"), &Tree::_scroll_to_item);
ClassDB::bind_method(D_METHOD("set_hide_folding", "hide"), &Tree::set_hide_folding);
ClassDB::bind_method(D_METHOD("is_folding_hidden"), &Tree::is_folding_hidden);
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 2136bada0b..854b82ebd7 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -564,6 +564,10 @@ protected:
return get_item_rect(Object::cast_to<TreeItem>(p_item), p_column);
}
+ void _scroll_to_item(Object *p_item) {
+ scroll_to_item(Object::cast_to<TreeItem>(p_item));
+ }
+
public:
virtual String get_tooltip(const Point2 &p_pos) const override;