Browse Source

added icon updating to most ui elements

toger5 8 years ago
parent
commit
7793bfc544

+ 7 - 0
editor/code_editor.cpp

@@ -92,6 +92,13 @@ void FindReplaceBar::_notification(int p_what) {
 	} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
 
 		set_process_unhandled_input(is_visible_in_tree());
+	} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+
+		find_prev->set_icon(get_icon("MoveUp", "EditorIcons"));
+		find_next->set_icon(get_icon("MoveDown", "EditorIcons"));
+		hide_button->set_normal_texture(get_icon("Close", "EditorIcons"));
+		hide_button->set_hover_texture(get_icon("CloseHover", "EditorIcons"));
+		hide_button->set_pressed_texture(get_icon("Close", "EditorIcons"));
 	}
 }
 

+ 18 - 0
editor/editor_file_dialog.cpp

@@ -53,6 +53,7 @@ void EditorFileDialog::_notification(int p_what) {
 
 	if (p_what == NOTIFICATION_ENTER_TREE) {
 
+		//_update_icons
 		mode_thumbnails->set_icon(get_icon("FileThumbnail", "EditorIcons"));
 		mode_list->set_icon(get_icon("FileList", "EditorIcons"));
 		dir_prev->set_icon(get_icon("ArrowLeft", "EditorIcons"));
@@ -92,6 +93,23 @@ void EditorFileDialog::_notification(int p_what) {
 		if (show_hidden_files != show_hidden)
 			set_show_hidden_files(show_hidden);
 		set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int());
+
+		//_update_icons
+		mode_thumbnails->set_icon(get_icon("FileThumbnail", "EditorIcons"));
+		mode_list->set_icon(get_icon("FileList", "EditorIcons"));
+		dir_prev->set_icon(get_icon("ArrowLeft", "EditorIcons"));
+		dir_next->set_icon(get_icon("ArrowRight", "EditorIcons"));
+		dir_up->set_icon(get_icon("ArrowUp", "EditorIcons"));
+		refresh->set_icon(get_icon("Reload", "EditorIcons"));
+		favorite->set_icon(get_icon("Favorites", "EditorIcons"));
+
+		fav_up->set_icon(get_icon("MoveUp", "EditorIcons"));
+		fav_down->set_icon(get_icon("MoveDown", "EditorIcons"));
+		fav_rm->set_icon(get_icon("RemoveSmall", "EditorIcons"));
+
+		Theme::get_default()->clear_icon("ResizedFile", "EditorIcons");
+		Theme::get_default()->clear_icon("ResizedFolder", "EditorIcons");
+		update_file_list();
 	}
 }
 

+ 11 - 3
editor/editor_help.cpp

@@ -263,19 +263,22 @@ void EditorHelpSearch::_notification(int p_what) {
 
 	if (p_what == NOTIFICATION_ENTER_TREE) {
 
+		//_update_icons
 		search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
 
 		connect("confirmed", this, "_confirmed");
 		_update_search();
-	}
-
-	if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
+	} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
 
 		if (is_visible_in_tree()) {
 
 			search_box->call_deferred("grab_focus"); // still not visible
 			search_box->select_all();
 		}
+	} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+
+		//_update_icons
+		search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
 	}
 }
 
@@ -385,6 +388,7 @@ void EditorHelpIndex::_notification(int p_what) {
 
 	if (p_what == NOTIFICATION_ENTER_TREE) {
 
+		//_update_icons
 		search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
 		_update_class_list();
 
@@ -393,6 +397,10 @@ void EditorHelpIndex::_notification(int p_what) {
 	} else if (p_what == NOTIFICATION_POST_POPUP) {
 
 		search_box->call_deferred("grab_focus");
+	} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+
+		//_update_icons
+		search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
 	}
 }
 

+ 30 - 1
editor/editor_node.cpp

@@ -296,6 +296,35 @@ void EditorNode::_notification(int p_what) {
 			scene_tabs->set_min_width(0);
 		}
 		_update_scene_tabs();
+
+		//_update_icons
+		for (int i = 0; i < singleton->main_editor_buttons.size(); i++) {
+			main_editor_buttons[i]->set_icon(gui_base->get_icon(singleton->main_editor_buttons[i]->get_name(), "EditorIcons"));
+		}
+		play_button->set_icon(gui_base->get_icon("MainPlay", "EditorIcons"));
+		play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons"));
+		play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons"));
+		pause_button->set_icon(gui_base->get_icon("Pause", "EditorIcons"));
+		stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons"));
+
+		prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons"));
+		distraction_free->set_icon(gui_base->get_icon("DistractionFree", "EditorIcons"));
+
+		resource_new_button->set_icon(gui_base->get_icon("New", "EditorIcons"));
+		resource_load_button->set_icon(gui_base->get_icon("Load", "EditorIcons"));
+		resource_save_button->set_icon(gui_base->get_icon("Save", "EditorIcons"));
+
+		property_back->set_icon(gui_base->get_icon("Back", "EditorIcons"));
+		property_forward->set_icon(gui_base->get_icon("Forward", "EditorIcons"));
+		editor_history_menu->set_icon(gui_base->get_icon("History", "EditorIcons"));
+
+		search_button->set_icon(gui_base->get_icon("Search", "EditorIcons"));
+		object_menu->set_icon(gui_base->get_icon("Tools", "EditorIcons"));
+		// clear_button->set_icon(gui_base->get_icon("Close", "EditorIcons")); dont have access to that node. needs to become a class property
+		update_menu->set_icon(gui_base->get_icon("Collapse", "EditorIcons"));
+		dock_tab_move_left->set_icon(theme->get_icon("Back", "EditorIcons"));
+		dock_tab_move_right->set_icon(theme->get_icon("Forward", "EditorIcons"));
+		update_menu->set_icon(gui_base->get_icon("Progress1", "EditorIcons"));
 	}
 }
 
@@ -4917,7 +4946,7 @@ EditorNode::EditorNode() {
 	play_cc->set_margin(MARGIN_TOP, 5);
 
 	play_button_panel = memnew(PanelContainer);
-	play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles"));
+	// play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles"));
 	play_cc->add_child(play_button_panel);
 
 	HBoxContainer *play_hb = memnew(HBoxContainer);

+ 22 - 0
editor/filesystem_dock.cpp

@@ -199,11 +199,33 @@ void FileSystemDock::_notification(int p_what) {
 
 			int new_mode = int(EditorSettings::get_singleton()->get("docks/filesystem/display_mode"));
 
+			//_update_icons
+
+			button_reload->set_icon(get_icon("Reload", "EditorIcons"));
+			button_favorite->set_icon(get_icon("Favorites", "EditorIcons"));
+			button_back->set_icon(get_icon("Filesystem", "EditorIcons"));
+			if (display_mode == DISPLAY_THUMBNAILS) {
+				button_display_mode->set_icon(get_icon("FileList", "EditorIcons"));
+			} else {
+				button_display_mode->set_icon(get_icon("FileThumbnail", "EditorIcons"));
+			}
+
+			search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
+
+			button_hist_next->set_icon(get_icon("Forward", "EditorIcons"));
+			button_hist_prev->set_icon(get_icon("Back", "EditorIcons"));
+
+			Theme::get_default()->clear_icon("ResizedFolder", "EditorIcons");
+			Theme::get_default()->clear_icon("ResizedFile", "EditorIcons");
+
 			if (new_mode != display_mode) {
 				set_display_mode(new_mode);
 			} else {
 				_update_files(true);
 			}
+
+			_update_tree();
+
 		} break;
 	}
 }

+ 3 - 0
editor/node_dock.cpp

@@ -58,6 +58,9 @@ void NodeDock::_notification(int p_what) {
 	if (p_what == NOTIFICATION_ENTER_TREE) {
 		connections_button->set_icon(get_icon("Connect", "EditorIcons"));
 		groups_button->set_icon(get_icon("Groups", "EditorIcons"));
+	} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+		connections_button->set_icon(get_icon("Connect", "EditorIcons"));
+		groups_button->set_icon(get_icon("Groups", "EditorIcons"));
 	}
 }
 

+ 42 - 1
editor/plugins/canvas_item_editor_plugin.cpp

@@ -2320,7 +2320,6 @@ void CanvasItemEditor::_notification(int p_what) {
 		ungroup_button->set_icon(get_icon("Ungroup", "EditorIcons"));
 		key_insert_button->set_icon(get_icon("Key", "EditorIcons"));
 
-		//anchor_menu->add_icon_override("Align Top Left");
 		anchor_menu->set_icon(get_icon("Anchor", "EditorIcons"));
 		PopupMenu *p = anchor_menu->get_popup();
 
@@ -2347,6 +2346,48 @@ void CanvasItemEditor::_notification(int p_what) {
 
 		AnimationPlayerEditor::singleton->get_key_editor()->connect("visibility_changed", this, "_keying_changed");
 		_keying_changed();
+	} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+
+		select_sb->set_texture(get_icon("EditorRect2D", "EditorIcons"));
+
+		select_button->set_icon(get_icon("ToolSelect", "EditorIcons"));
+		list_select_button->set_icon(get_icon("ListSelect", "EditorIcons"));
+		move_button->set_icon(get_icon("ToolMove", "EditorIcons"));
+		rotate_button->set_icon(get_icon("ToolRotate", "EditorIcons"));
+		pan_button->set_icon(get_icon("ToolPan", "EditorIcons"));
+		pivot_button->set_icon(get_icon("EditPivot", "EditorIcons"));
+		select_handle = get_icon("EditorHandle", "EditorIcons");
+		anchor_handle = get_icon("EditorControlAnchor", "EditorIcons");
+		lock_button->set_icon(get_icon("Lock", "EditorIcons"));
+		unlock_button->set_icon(get_icon("Unlock", "EditorIcons"));
+		group_button->set_icon(get_icon("Group", "EditorIcons"));
+		ungroup_button->set_icon(get_icon("Ungroup", "EditorIcons"));
+		key_insert_button->set_icon(get_icon("Key", "EditorIcons"));
+
+		anchor_menu->set_icon(get_icon("Anchor", "EditorIcons"));
+		PopupMenu *p = anchor_menu->get_popup();
+		p->clear();
+
+		p->add_icon_item(get_icon("ControlAlignTopLeft", "EditorIcons"), "Top Left", ANCHOR_ALIGN_TOP_LEFT);
+		p->add_icon_item(get_icon("ControlAlignTopRight", "EditorIcons"), "Top Right", ANCHOR_ALIGN_TOP_RIGHT);
+		p->add_icon_item(get_icon("ControlAlignBottomRight", "EditorIcons"), "Bottom Right", ANCHOR_ALIGN_BOTTOM_RIGHT);
+		p->add_icon_item(get_icon("ControlAlignBottomLeft", "EditorIcons"), "Bottom Left", ANCHOR_ALIGN_BOTTOM_LEFT);
+		p->add_separator();
+		p->add_icon_item(get_icon("ControlAlignLeftCenter", "EditorIcons"), "Center Left", ANCHOR_ALIGN_CENTER_LEFT);
+		p->add_icon_item(get_icon("ControlAlignTopCenter", "EditorIcons"), "Center Top", ANCHOR_ALIGN_CENTER_TOP);
+		p->add_icon_item(get_icon("ControlAlignRightCenter", "EditorIcons"), "Center Right", ANCHOR_ALIGN_CENTER_RIGHT);
+		p->add_icon_item(get_icon("ControlAlignBottomCenter", "EditorIcons"), "Center Bottom", ANCHOR_ALIGN_CENTER_BOTTOM);
+		p->add_icon_item(get_icon("ControlAlignCenter", "EditorIcons"), "Center", ANCHOR_ALIGN_CENTER);
+		p->add_separator();
+		p->add_icon_item(get_icon("ControlAlignLeftWide", "EditorIcons"), "Left Wide", ANCHOR_ALIGN_LEFT_WIDE);
+		p->add_icon_item(get_icon("ControlAlignTopWide", "EditorIcons"), "Top Wide", ANCHOR_ALIGN_TOP_WIDE);
+		p->add_icon_item(get_icon("ControlAlignRightWide", "EditorIcons"), "Right Wide", ANCHOR_ALIGN_RIGHT_WIDE);
+		p->add_icon_item(get_icon("ControlAlignBottomWide", "EditorIcons"), "Bottom Wide", ANCHOR_ALIGN_BOTTOM_WIDE);
+		p->add_icon_item(get_icon("ControlVcenterWide", "EditorIcons"), "VCenter Wide ", ANCHOR_ALIGN_VCENTER_WIDE);
+		p->add_icon_item(get_icon("ControlHcenterWide", "EditorIcons"), "HCenter Wide ", ANCHOR_ALIGN_HCENTER_WIDE);
+		p->add_separator();
+		p->add_icon_item(get_icon("ControlAlignWide", "EditorIcons"), "Full Rect", ANCHOR_ALIGN_WIDE);
+		p->add_icon_item(get_icon("ControlAlignWide", "EditorIcons"), "Full Rect and Fit Parent", ANCHOR_ALIGN_WIDE_FIT);
 	}
 }
 

+ 7 - 0
editor/plugins/script_editor_plugin.cpp

@@ -1150,6 +1150,13 @@ void ScriptEditor::_notification(int p_what) {
 		case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
 
 			tab_container->add_style_override("panel", editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles"));
+
+			help_search->set_icon(get_icon("HelpSearch", "EditorIcons"));
+			site_search->set_icon(get_icon("Instance", "EditorIcons"));
+			class_search->set_icon(get_icon("ClassList", "EditorIcons"));
+
+			script_forward->set_icon(get_icon("Forward", "EditorIcons"));
+			script_back->set_icon(get_icon("Back", "EditorIcons"));
 		} break;
 
 		default:

+ 14 - 0
editor/plugins/spatial_editor_plugin.cpp

@@ -3652,6 +3652,20 @@ void SpatialEditor::_notification(int p_what) {
 		_finish_indicators();
 		memdelete(gizmos);
 	}
+	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_MOVE]->set_icon(get_icon("ToolMove", "EditorIcons"));
+		tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_icon("ToolRotate", "EditorIcons"));
+		tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon(get_icon("ToolScale", "EditorIcons"));
+		tool_button[SpatialEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_icon("ListSelect", "EditorIcons"));
+
+		view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_icon("Panels1", "EditorIcons"));
+		view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_icon("Panels2", "EditorIcons"));
+		view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS_ALT), get_icon("Panels2Alt", "EditorIcons"));
+		view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS), get_icon("Panels3", "EditorIcons"));
+		view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_3_VIEWPORTS_ALT), get_icon("Panels3Alt", "EditorIcons"));
+		view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_4_VIEWPORTS), get_icon("Panels4", "EditorIcons"));
+	}
 }
 
 void SpatialEditor::add_control_to_menu_panel(Control *p_control) {

+ 8 - 0
editor/scene_tree_dock.cpp

@@ -736,6 +736,14 @@ void SceneTreeDock::_notification(int p_what) {
 		case NOTIFICATION_EXIT_TREE: {
 			clear_inherit_confirm->disconnect("confirmed", this, "_tool_selected");
 		} break;
+		case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+			button_add->set_icon(get_icon("Add", "EditorIcons"));
+			button_instance->set_icon(get_icon("Instance", "EditorIcons"));
+			button_create_script->set_icon(get_icon("ScriptCreate", "EditorIcons"));
+			button_clear_script->set_icon(get_icon("ScriptRemove", "EditorIcons"));
+
+			filter->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
+		} break;
 	}
 }