mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-04 07:31:16 +00:00 
			
		
		
		
	Add auto translate mode for items in PopupMenu and OptionButton
This commit is contained in:
		
							parent
							
								
									cae3d722a3
								
							
						
					
					
						commit
						82a0290871
					
				
					 13 changed files with 156 additions and 21 deletions
				
			
		| 
						 | 
				
			
			@ -824,7 +824,8 @@ void ScriptEditor::_update_recent_scripts() {
 | 
			
		|||
 | 
			
		||||
	recent_scripts->add_separator();
 | 
			
		||||
	recent_scripts->add_shortcut(ED_GET_SHORTCUT("script_editor/clear_recent"));
 | 
			
		||||
	recent_scripts->set_item_disabled(recent_scripts->get_item_id(recent_scripts->get_item_count() - 1), rc.is_empty());
 | 
			
		||||
	recent_scripts->set_item_auto_translate_mode(-1, AUTO_TRANSLATE_MODE_ALWAYS);
 | 
			
		||||
	recent_scripts->set_item_disabled(-1, rc.is_empty());
 | 
			
		||||
 | 
			
		||||
	recent_scripts->reset_size();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -4288,6 +4289,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 | 
			
		|||
	file_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_editor/reopen_closed_script"), FILE_REOPEN_CLOSED);
 | 
			
		||||
 | 
			
		||||
	recent_scripts = memnew(PopupMenu);
 | 
			
		||||
	recent_scripts->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
 | 
			
		||||
	file_menu->get_popup()->add_submenu_node_item(TTR("Open Recent"), recent_scripts, FILE_OPEN_RECENT);
 | 
			
		||||
	recent_scripts->connect(SceneStringName(id_pressed), callable_mp(this, &ScriptEditor::_open_recent_script));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue