mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	Disable multi-window buttons instead of hiding them when support is unavailable
This is more explicit as for why this functionality isn't available depending on editor settings and current platform. This also exposes a `EditorInterface.is_multi_window_enabled()` method so that editor plugins can easily query whether the editor is able and expected to create multiple windows.
This commit is contained in:
		
							parent
							
								
									17e7f85c06
								
							
						
					
					
						commit
						04a930d9a6
					
				
					 10 changed files with 81 additions and 30 deletions
				
			
		|  | @ -643,20 +643,21 @@ ShaderEditorPlugin::ShaderEditorPlugin() { | |||
| 		file_menu->get_popup()->set_item_disabled(file_menu->get_popup()->get_item_index(i), true); | ||||
| 	} | ||||
| 
 | ||||
| 	if (window_wrapper->is_window_available()) { | ||||
| 		Control *padding = memnew(Control); | ||||
| 		padding->set_h_size_flags(Control::SIZE_EXPAND_FILL); | ||||
| 		menu_hb->add_child(padding); | ||||
| 	Control *padding = memnew(Control); | ||||
| 	padding->set_h_size_flags(Control::SIZE_EXPAND_FILL); | ||||
| 	menu_hb->add_child(padding); | ||||
| 
 | ||||
| 		make_floating = memnew(ScreenSelect); | ||||
| 		make_floating->set_flat(true); | ||||
| 	make_floating = memnew(ScreenSelect); | ||||
| 	make_floating->set_flat(true); | ||||
| 	make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true)); | ||||
| 	if (!make_floating->is_disabled()) { | ||||
| 		// Override default ScreenSelect tooltip if multi-window support is available.
 | ||||
| 		make_floating->set_tooltip_text(TTR("Make the shader editor floating.")); | ||||
| 		make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true)); | ||||
| 
 | ||||
| 		menu_hb->add_child(make_floating); | ||||
| 		window_wrapper->connect("window_visibility_changed", callable_mp(this, &ShaderEditorPlugin::_window_changed)); | ||||
| 	} | ||||
| 
 | ||||
| 	menu_hb->add_child(make_floating); | ||||
| 	window_wrapper->connect("window_visibility_changed", callable_mp(this, &ShaderEditorPlugin::_window_changed)); | ||||
| 
 | ||||
| 	shader_list = memnew(ItemList); | ||||
| 	shader_list->set_auto_translate(false); | ||||
| 	shader_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Hugo Locurcio
						Hugo Locurcio