1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Unify and streamline connecting to Resource changes

This commit is contained in:
kobewi
2023-07-03 21:29:37 +02:00
parent 2c55214068
commit de4a3fa151
98 changed files with 341 additions and 434 deletions

View File

@@ -43,11 +43,11 @@ void StyleBoxPreview::_grid_preview_toggled(bool p_active) {
void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) {
if (stylebox.is_valid()) {
stylebox->disconnect("changed", callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
stylebox->disconnect_changed(callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
}
stylebox = p_stylebox;
if (stylebox.is_valid()) {
stylebox->connect("changed", callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
stylebox->connect_changed(callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
}
Ref<StyleBoxTexture> sbt = stylebox;
grid_preview->set_visible(sbt.is_valid());