Unify and streamline connecting to Resource changes
This commit is contained in:
parent
2c55214068
commit
de4a3fa151
98 changed files with 341 additions and 434 deletions
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "button.h"
|
||||
|
||||
#include "core/core_string_names.h"
|
||||
#include "core/string/translation.h"
|
||||
#include "servers/rendering_server.h"
|
||||
|
||||
|
|
@ -540,13 +539,13 @@ void Button::set_icon(const Ref<Texture2D> &p_icon) {
|
|||
}
|
||||
|
||||
if (icon.is_valid()) {
|
||||
icon->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Button::_texture_changed));
|
||||
icon->disconnect_changed(callable_mp(this, &Button::_texture_changed));
|
||||
}
|
||||
|
||||
icon = p_icon;
|
||||
|
||||
if (icon.is_valid()) {
|
||||
icon->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Button::_texture_changed));
|
||||
icon->connect_changed(callable_mp(this, &Button::_texture_changed));
|
||||
}
|
||||
|
||||
queue_redraw();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue