tree: always emit item_edited

This commit is contained in:
Nathan Franke 2022-05-26 05:12:57 -05:00
parent 08e540a2ac
commit 2d14164bca
No known key found for this signature in database
GPG Key ID: 082B90CF10A5B648
2 changed files with 5 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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);