diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-05-08 15:52:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 15:52:49 +0200 |
commit | b96cd577c3022c8431c7911b24c9d294c7f9c8d9 (patch) | |
tree | d7dde4420afffefe31683272852ed3df5165eb14 /editor/editor_log.cpp | |
parent | b0d73d3099b5c4879224fd6b3786d62299e1a288 (diff) | |
parent | aa4e27084fc49a72fedce8f1554962418b2b7671 (diff) |
Merge pull request #28009 from kbake/output-context-menu-27543
Adds Copy button to output panel
Diffstat (limited to 'editor/editor_log.cpp')
-rw-r--r-- | editor/editor_log.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index aaca47622d..b5cdc76115 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -78,10 +78,19 @@ void EditorLog::_clear_request() { tool_button->set_icon(Ref<Texture>()); } +void EditorLog::_copy_request() { + + log->selection_copy(); +} + void EditorLog::clear() { _clear_request(); } +void EditorLog::copy() { + _copy_request(); +} + void EditorLog::add_message(const String &p_msg, MessageType p_type) { log->add_newline(); @@ -125,7 +134,9 @@ void EditorLog::_undo_redo_cbk(void *p_self, const String &p_name) { void EditorLog::_bind_methods() { ClassDB::bind_method(D_METHOD("_clear_request"), &EditorLog::_clear_request); + ClassDB::bind_method(D_METHOD("_copy_request"), &EditorLog::_copy_request); ADD_SIGNAL(MethodInfo("clear_request")); + ADD_SIGNAL(MethodInfo("copy_request")); } EditorLog::EditorLog() { @@ -139,6 +150,12 @@ EditorLog::EditorLog() { title->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(title); + copybutton = memnew(Button); + hb->add_child(copybutton); + copybutton->set_text(TTR("Copy")); + copybutton->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KEY_MASK_CMD | KEY_C)); + copybutton->connect("pressed", this, "_copy_request"); + clearbutton = memnew(Button); hb->add_child(clearbutton); clearbutton->set_text(TTR("Clear")); |