You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-27 15:57:02 +00:00
Update VisualShader on theme changes
This commit is contained in:
@@ -2630,6 +2630,10 @@ void VisualShaderEditor::_update_graph() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_inside_tree()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VisualShader::Type type = get_current_shader_type();
|
VisualShader::Type type = get_current_shader_type();
|
||||||
|
|
||||||
graph->clear_connections();
|
graph->clear_connections();
|
||||||
@@ -5343,12 +5347,18 @@ void VisualShaderEditor::_notification(int p_what) {
|
|||||||
|
|
||||||
if (is_visible_in_tree()) {
|
if (is_visible_in_tree()) {
|
||||||
_update_graph();
|
_update_graph();
|
||||||
|
} else {
|
||||||
|
theme_dirty = true;
|
||||||
}
|
}
|
||||||
update_toggle_files_button();
|
update_toggle_files_button();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||||
update_toggle_files_button();
|
update_toggle_files_button();
|
||||||
|
if (theme_dirty && is_visible_in_tree()) {
|
||||||
|
theme_dirty = false;
|
||||||
|
_update_graph();
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_DRAG_BEGIN: {
|
case NOTIFICATION_DRAG_BEGIN: {
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ class VisualShaderEditor : public ShaderEditor {
|
|||||||
CheckBox *custom_mode_box = nullptr;
|
CheckBox *custom_mode_box = nullptr;
|
||||||
bool custom_mode_enabled = false;
|
bool custom_mode_enabled = false;
|
||||||
|
|
||||||
|
bool theme_dirty = false;
|
||||||
bool pending_update_preview = false;
|
bool pending_update_preview = false;
|
||||||
bool shader_error = false;
|
bool shader_error = false;
|
||||||
AcceptDialog *code_preview_window = nullptr;
|
AcceptDialog *code_preview_window = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user