Skip to content

Commit 68a04bb

Browse files
committed
Merge pull request godotengine#96142 from timothyqiu/one-signal-to-invalidate-them-all
Fix collapsing `TreeItem` not updating horizontal scrollbar
2 parents 36f95ef + d16dcbb commit 68a04bb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scene/gui/tree.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4490,9 +4490,16 @@ void Tree::item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mous
44904490
}
44914491

44924492
void Tree::item_changed(int p_column, TreeItem *p_item) {
4493-
if (p_item != nullptr && p_column >= 0 && p_column < p_item->cells.size()) {
4494-
p_item->cells.write[p_column].dirty = true;
4495-
columns.write[p_column].cached_minimum_width_dirty = true;
4493+
if (p_item != nullptr) {
4494+
if (p_column >= 0 && p_column < p_item->cells.size()) {
4495+
p_item->cells.write[p_column].dirty = true;
4496+
columns.write[p_column].cached_minimum_width_dirty = true;
4497+
} else if (p_column == -1) {
4498+
for (int i = 0; i < p_item->cells.size(); i++) {
4499+
p_item->cells.write[i].dirty = true;
4500+
columns.write[i].cached_minimum_width_dirty = true;
4501+
}
4502+
}
44964503
}
44974504
queue_redraw();
44984505
}

0 commit comments

Comments
 (0)