diff options
author | Nathan Franke <me@nathan.sh> | 2022-05-26 05:12:57 -0500 |
---|---|---|
committer | Nathan Franke <me@nathan.sh> | 2022-05-26 05:12:57 -0500 |
commit | 2d14164bca2f2df007f3f56dde6061051b544221 (patch) | |
tree | f91fd8a8ee7e31fc78ef26e1eb69b043e977c7f9 /scene | |
parent | 08e540a2ac8067013983ba06b612ac2a29f25dd3 (diff) |
tree: always emit item_edited
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tree.cpp | 9 | ||||
-rw-r--r-- | scene/gui/tree.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 4d18bc91c4..8f292533e6 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3971,16 +3971,15 @@ TreeItem *Tree::get_last_item() const { return last; } -void Tree::item_edited(int p_column, TreeItem *p_item, MouseButton p_mouse_index) { +void Tree::item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mouse_index) { edited_item = p_item; edited_col = p_column; if (p_item != nullptr && p_column >= 0 && p_column < p_item->cells.size()) { edited_item->cells.write[p_column].dirty = true; } - if (p_mouse_index == MouseButton::NONE) { - emit_signal(SNAME("item_edited")); - } else { - emit_signal(SNAME("custom_item_clicked"), p_mouse_index); + emit_signal(SNAME("item_edited")); + if (p_custom_mouse_index != MouseButton::NONE) { + emit_signal(SNAME("custom_item_clicked"), p_custom_mouse_index); } } diff --git a/scene/gui/tree.h b/scene/gui/tree.h index a70f24cb62..0a8dd3204a 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -474,7 +474,7 @@ private: void _notification(int p_what); - void item_edited(int p_column, TreeItem *p_item, MouseButton p_mouse_index = MouseButton::NONE); + void item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mouse_index = MouseButton::NONE); void item_changed(int p_column, TreeItem *p_item); void item_selected(int p_column, TreeItem *p_item); void item_deselected(int p_column, TreeItem *p_item); |