mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fix some inspector action buttons not updating icon when theme changes
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include "packed_scene_editor_plugin.h"
|
||||
|
||||
#include "editor/editor_node.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
|
||||
void PackedSceneEditor::_on_open_scene_pressed() {
|
||||
@@ -39,18 +38,10 @@ void PackedSceneEditor::_on_open_scene_pressed() {
|
||||
callable_mp(EditorNode::get_singleton(), &EditorNode::load_scene).call_deferred(packed_scene->get_path(), false, false, false, false);
|
||||
}
|
||||
|
||||
void PackedSceneEditor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
open_scene_button->set_button_icon(get_editor_theme_icon(SNAME("PackedScene")));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
PackedSceneEditor::PackedSceneEditor(Ref<PackedScene> &p_packed_scene) {
|
||||
packed_scene = p_packed_scene;
|
||||
|
||||
open_scene_button = EditorInspector::create_inspector_action_button(TTR("Open Scene"));
|
||||
EditorInspectorActionButton *open_scene_button = memnew(EditorInspectorActionButton(TTRC("Open Scene"), SNAME("PackedScene")));
|
||||
open_scene_button->connect(SceneStringName(pressed), callable_mp(this, &PackedSceneEditor::_on_open_scene_pressed));
|
||||
open_scene_button->set_disabled(!packed_scene->get_path().get_file().is_valid_filename());
|
||||
add_child(open_scene_button);
|
||||
|
||||
Reference in New Issue
Block a user