From 06c7940a5aa5eb5b7423cb69687eace9de4a7fe2 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Tue, 28 Feb 2023 16:19:48 +0300 Subject: [PATCH] Enable `RichTextLabel` context menu if selection is enabled --- editor/editor_help.cpp | 1 + editor/editor_log.cpp | 1 + editor/editor_node.cpp | 1 + editor/plugins/asset_library_editor_plugin.cpp | 1 + editor/plugins/script_text_editor.cpp | 2 ++ editor/plugins/shader_file_editor_plugin.cpp | 1 + editor/plugins/text_shader_editor.cpp | 1 + editor/plugins/version_control_editor_plugin.cpp | 1 + 8 files changed, 9 insertions(+) diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index acbc3ce0dc7..cc569e777b0 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -2343,6 +2343,7 @@ EditorHelp::EditorHelp() { status_bar->add_child(toggle_scripts_button); class_desc->set_selection_enabled(true); + class_desc->set_context_menu_enabled(true); class_desc->hide(); } diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 296181f79da..1f43ee53fa5 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -380,6 +380,7 @@ EditorLog::EditorLog() { log->set_use_bbcode(true); log->set_scroll_follow(true); log->set_selection_enabled(true); + log->set_context_menu_enabled(true); log->set_focus_mode(FOCUS_CLICK); log->set_v_size_flags(SIZE_EXPAND_FILL); log->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b36f74db9c4..9ea242a6d68 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -8054,6 +8054,7 @@ EditorNode::EditorNode() { execute_outputs = memnew(RichTextLabel); execute_outputs->set_selection_enabled(true); + execute_outputs->set_context_menu_enabled(true); execute_output_dialog = memnew(AcceptDialogAutoReparent); execute_output_dialog->add_child(execute_outputs); execute_output_dialog->set_title(""); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 26397652837..e806d6c5de4 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -245,6 +245,7 @@ void EditorAssetLibraryItemDescription::configure(const String &p_title, int p_a description->add_text("\n" + TTR("Description:") + "\n\n"); description->append_text(p_description); description->set_selection_enabled(true); + description->set_context_menu_enabled(true); set_title(p_title); } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index c1a52836629..9b84c33ff27 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -2174,6 +2174,7 @@ ScriptTextEditor::ScriptTextEditor() { warnings_panel->set_h_size_flags(SIZE_EXPAND_FILL); warnings_panel->set_meta_underline(true); warnings_panel->set_selection_enabled(true); + warnings_panel->set_context_menu_enabled(true); warnings_panel->set_focus_mode(FOCUS_CLICK); warnings_panel->hide(); @@ -2182,6 +2183,7 @@ ScriptTextEditor::ScriptTextEditor() { errors_panel->set_h_size_flags(SIZE_EXPAND_FILL); errors_panel->set_meta_underline(true); errors_panel->set_selection_enabled(true); + errors_panel->set_context_menu_enabled(true); errors_panel->set_focus_mode(FOCUS_CLICK); errors_panel->hide(); diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index a83a48da1f7..ad8d93a719e 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -289,6 +289,7 @@ ShaderFileEditor::ShaderFileEditor() { error_text = memnew(RichTextLabel); error_text->set_v_size_flags(SIZE_EXPAND_FILL); error_text->set_selection_enabled(true); + error_text->set_context_menu_enabled(true); main_vb->add_child(error_text); } diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index ffd95648167..881b210004b 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -1169,6 +1169,7 @@ TextShaderEditor::TextShaderEditor() { warnings_panel->set_h_size_flags(SIZE_EXPAND_FILL); warnings_panel->set_meta_underline(true); warnings_panel->set_selection_enabled(true); + warnings_panel->set_context_menu_enabled(true); warnings_panel->set_focus_mode(FOCUS_CLICK); warnings_panel->hide(); warnings_panel->connect("meta_clicked", callable_mp(this, &TextShaderEditor::_warning_clicked)); diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index c404e12d394..a34101a217e 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -1504,6 +1504,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff->set_v_size_flags(TextEdit::SIZE_EXPAND_FILL); diff->set_use_bbcode(true); diff->set_selection_enabled(true); + diff->set_context_menu_enabled(true); version_control_dock->add_child(diff); _update_set_up_warning("");