Merge pull request #25913 from Chaosus/fix_gizmo_icons
Fix icon color for gizmos menu when theme changed
This commit is contained in:
commit
4f6dd779a3
2 changed files with 13 additions and 8 deletions
|
@ -4856,6 +4856,13 @@ void SpatialEditor::_update_gizmos_menu() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpatialEditor::_update_gizmos_menu_theme() {
|
||||||
|
for (int i = 0; i < gizmo_plugins.size(); ++i) {
|
||||||
|
if (!gizmo_plugins[i]->can_be_hidden()) continue;
|
||||||
|
gizmos_menu->set_item_icon(gizmos_menu->get_item_index(i), gizmos_menu->get_icon("visibility_visible"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SpatialEditor::_init_grid() {
|
void SpatialEditor::_init_grid() {
|
||||||
|
|
||||||
PoolVector<Color> grid_colors[3];
|
PoolVector<Color> grid_colors[3];
|
||||||
|
@ -5145,20 +5152,17 @@ void SpatialEditor::_notification(int p_what) {
|
||||||
get_tree()->connect("node_removed", this, "_node_removed");
|
get_tree()->connect("node_removed", this, "_node_removed");
|
||||||
EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", this, "_refresh_menu_icons");
|
EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", this, "_refresh_menu_icons");
|
||||||
editor_selection->connect("selection_changed", this, "_refresh_menu_icons");
|
editor_selection->connect("selection_changed", this, "_refresh_menu_icons");
|
||||||
}
|
} else if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
|
||||||
|
|
||||||
_register_all_gizmos();
|
_register_all_gizmos();
|
||||||
_update_gizmos_menu();
|
_update_gizmos_menu();
|
||||||
_init_indicators();
|
_init_indicators();
|
||||||
}
|
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||||
|
_update_gizmos_menu_theme();
|
||||||
if (p_what == NOTIFICATION_EXIT_TREE) {
|
} else if (p_what == NOTIFICATION_EXIT_TREE) {
|
||||||
|
|
||||||
_finish_indicators();
|
_finish_indicators();
|
||||||
}
|
} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||||
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
|
||||||
tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons"));
|
tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons"));
|
||||||
tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons"));
|
tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons"));
|
||||||
tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons"));
|
tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons"));
|
||||||
|
|
|
@ -618,6 +618,7 @@ private:
|
||||||
void _instance_scene();
|
void _instance_scene();
|
||||||
void _init_indicators();
|
void _init_indicators();
|
||||||
void _update_gizmos_menu();
|
void _update_gizmos_menu();
|
||||||
|
void _update_gizmos_menu_theme();
|
||||||
void _init_grid();
|
void _init_grid();
|
||||||
void _finish_indicators();
|
void _finish_indicators();
|
||||||
void _finish_grid();
|
void _finish_grid();
|
||||||
|
|
Loading…
Reference in a new issue