You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Expose FileDialog callbacks for getting custom icons
This commit is contained in:
@@ -208,11 +208,20 @@ void ItemList::set_item_icon(int p_idx, const Ref<Texture2D> &p_icon) {
|
||||
}
|
||||
ERR_FAIL_INDEX(p_idx, items.size());
|
||||
|
||||
if (items[p_idx].icon == p_icon) {
|
||||
Item &item = items.write[p_idx];
|
||||
if (item.icon == p_icon) {
|
||||
return;
|
||||
}
|
||||
|
||||
items.write[p_idx].icon = p_icon;
|
||||
const Callable redraw = callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw);
|
||||
if (item.icon.is_valid()) {
|
||||
item.icon->disconnect_changed(redraw);
|
||||
}
|
||||
item.icon = p_icon;
|
||||
if (p_icon.is_valid()) {
|
||||
p_icon->connect_changed(redraw);
|
||||
}
|
||||
|
||||
queue_redraw();
|
||||
shape_changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user