mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	Add custom background line colour to TextEdit and remove marked lines
This commit is contained in:
		
							parent
							
								
									1cc8cc96cb
								
							
						
					
					
						commit
						00e10a842f
					
				
					 13 changed files with 121 additions and 184 deletions
				
			
		|  | @ -1474,6 +1474,34 @@ void CodeTextEditor::goto_error() { | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| void CodeTextEditor::_update_text_editor_theme() { | ||||
| 	text_editor->add_theme_color_override("background_color", EDITOR_GET("text_editor/highlighting/background_color")); | ||||
| 	text_editor->add_theme_color_override("completion_background_color", EDITOR_GET("text_editor/highlighting/completion_background_color")); | ||||
| 	text_editor->add_theme_color_override("completion_selected_color", EDITOR_GET("text_editor/highlighting/completion_selected_color")); | ||||
| 	text_editor->add_theme_color_override("completion_existing_color", EDITOR_GET("text_editor/highlighting/completion_existing_color")); | ||||
| 	text_editor->add_theme_color_override("completion_scroll_color", EDITOR_GET("text_editor/highlighting/completion_scroll_color")); | ||||
| 	text_editor->add_theme_color_override("completion_font_color", EDITOR_GET("text_editor/highlighting/completion_font_color")); | ||||
| 	text_editor->add_theme_color_override("font_color", EDITOR_GET("text_editor/highlighting/text_color")); | ||||
| 	text_editor->add_theme_color_override("line_number_color", EDITOR_GET("text_editor/highlighting/line_number_color")); | ||||
| 	text_editor->add_theme_color_override("caret_color", EDITOR_GET("text_editor/highlighting/caret_color")); | ||||
| 	text_editor->add_theme_color_override("caret_background_color", EDITOR_GET("text_editor/highlighting/caret_background_color")); | ||||
| 	text_editor->add_theme_color_override("font_selected_color", EDITOR_GET("text_editor/highlighting/text_selected_color")); | ||||
| 	text_editor->add_theme_color_override("selection_color", EDITOR_GET("text_editor/highlighting/selection_color")); | ||||
| 	text_editor->add_theme_color_override("brace_mismatch_color", EDITOR_GET("text_editor/highlighting/brace_mismatch_color")); | ||||
| 	text_editor->add_theme_color_override("current_line_color", EDITOR_GET("text_editor/highlighting/current_line_color")); | ||||
| 	text_editor->add_theme_color_override("line_length_guideline_color", EDITOR_GET("text_editor/highlighting/line_length_guideline_color")); | ||||
| 	text_editor->add_theme_color_override("word_highlighted_color", EDITOR_GET("text_editor/highlighting/word_highlighted_color")); | ||||
| 	text_editor->add_theme_color_override("bookmark_color", EDITOR_GET("text_editor/highlighting/bookmark_color")); | ||||
| 	text_editor->add_theme_color_override("breakpoint_color", EDITOR_GET("text_editor/highlighting/breakpoint_color")); | ||||
| 	text_editor->add_theme_color_override("executing_line_color", EDITOR_GET("text_editor/highlighting/executing_line_color")); | ||||
| 	text_editor->add_theme_color_override("code_folding_color", EDITOR_GET("text_editor/highlighting/code_folding_color")); | ||||
| 	text_editor->add_theme_color_override("search_result_color", EDITOR_GET("text_editor/highlighting/search_result_color")); | ||||
| 	text_editor->add_theme_color_override("search_result_border_color", EDITOR_GET("text_editor/highlighting/search_result_border_color")); | ||||
| 	text_editor->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); | ||||
| 	emit_signal("load_theme_settings"); | ||||
| 	_load_theme_settings(); | ||||
| } | ||||
| 
 | ||||
| void CodeTextEditor::_update_font() { | ||||
| 	text_editor->add_theme_font_override("font", get_theme_font("source", "EditorFonts")); | ||||
| 	text_editor->add_theme_font_size_override("font_size", get_theme_font_size("source_size", "EditorFonts")); | ||||
|  | @ -1497,6 +1525,7 @@ void CodeTextEditor::_update_font() { | |||
| } | ||||
| 
 | ||||
| void CodeTextEditor::_on_settings_change() { | ||||
| 	_update_text_editor_theme(); | ||||
| 	_update_font(); | ||||
| 
 | ||||
| 	font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size"); | ||||
|  | @ -1583,14 +1612,11 @@ void CodeTextEditor::_error_pressed(const Ref<InputEvent> &p_event) { | |||
| 
 | ||||
| void CodeTextEditor::_notification(int p_what) { | ||||
| 	switch (p_what) { | ||||
| 		case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { | ||||
| 			_load_theme_settings(); | ||||
| 			emit_signal("load_theme_settings"); | ||||
| 		} break; | ||||
| 		case NOTIFICATION_THEME_CHANGED: { | ||||
| 			if (toggle_scripts_button->is_visible()) { | ||||
| 				update_toggle_scripts_button(); | ||||
| 			} | ||||
| 			_update_text_editor_theme(); | ||||
| 			_update_font(); | ||||
| 		} break; | ||||
| 		case NOTIFICATION_ENTER_TREE: { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Paulb23
						Paulb23