Added shortcust for toggling the default bottom menu items. CTRL + ALT + 1 - 5.

This commit is contained in:
Relintai 2023-09-09 14:38:41 +02:00
parent cf7ca783c7
commit f315784d22
4 changed files with 7 additions and 2 deletions

View File

@ -1049,7 +1049,8 @@ void EditorAudioBuses::_update_buses() {
EditorAudioBuses *EditorAudioBuses::register_editor() { EditorAudioBuses *EditorAudioBuses::register_editor() {
EditorAudioBuses *audio_buses = memnew(EditorAudioBuses); EditorAudioBuses *audio_buses = memnew(EditorAudioBuses);
EditorNode::get_singleton()->add_bottom_panel_item(TTR("Audio"), audio_buses); ToolButton *tb = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Audio"), audio_buses);
tb->set_shortcut(ED_SHORTCUT("audio_bus_editor/toggle_audio_panel", TTR("Toggle Audio Panel"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_2));
return audio_buses; return audio_buses;
} }

View File

@ -6913,6 +6913,7 @@ EditorNode::EditorNode() {
log = memnew(EditorLog); log = memnew(EditorLog);
ToolButton *output_button = add_bottom_panel_item(TTR("Output"), log); ToolButton *output_button = add_bottom_panel_item(TTR("Output"), log);
output_button->set_shortcut(ED_SHORTCUT("editor/toggle_output_panel", TTR("Toggle Output Panel"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_1));
log->set_tool_button(output_button); log->set_tool_button(output_button);
old_split_ofs = 0; old_split_ofs = 0;

View File

@ -1886,7 +1886,8 @@ AnimationPlayerEditorPlugin::AnimationPlayerEditorPlugin(EditorNode *p_node) {
editor = p_node; editor = p_node;
anim_editor = memnew(AnimationPlayerEditor(editor, this)); anim_editor = memnew(AnimationPlayerEditor(editor, this));
anim_editor->set_undo_redo(EditorNode::get_undo_redo()); anim_editor->set_undo_redo(EditorNode::get_undo_redo());
editor->add_bottom_panel_item(TTR("Animation"), anim_editor); ToolButton *tb = editor->add_bottom_panel_item(TTR("Animation"), anim_editor);
tb->set_shortcut(ED_SHORTCUT("animation_player_editor/toggle_animation_panel", TTR("Toggle Animation Panel"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_3));
} }
AnimationPlayerEditorPlugin::~AnimationPlayerEditorPlugin() { AnimationPlayerEditorPlugin::~AnimationPlayerEditorPlugin() {

View File

@ -3483,6 +3483,7 @@ EditorScriptEditor::EditorScriptEditor(EditorNode *p_editor) {
script_editor = this; script_editor = this;
Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger); Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger);
db->set_shortcut(ED_SHORTCUT("debugger/toggle_debugger_panel", TTR("Toggle Debugger Panel"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_4));
// Add separation for the warning/error icon that is displayed later. // Add separation for the warning/error icon that is displayed later.
db->add_theme_constant_override("hseparation", 6 * EDSCALE); db->add_theme_constant_override("hseparation", 6 * EDSCALE);
debugger->set_tool_button(db); debugger->set_tool_button(db);
@ -3507,6 +3508,7 @@ EditorScriptEditor::EditorScriptEditor(EditorNode *p_editor) {
add_child(find_in_files_dialog); add_child(find_in_files_dialog);
find_in_files = memnew(FindInFilesPanel); find_in_files = memnew(FindInFilesPanel);
find_in_files_button = editor->add_bottom_panel_item(TTR("Search Results"), find_in_files); find_in_files_button = editor->add_bottom_panel_item(TTR("Search Results"), find_in_files);
find_in_files_button->set_shortcut(ED_SHORTCUT("script_editor/toggle_search_results_panel", TTR("Toggle Search Results Panel"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_5));
find_in_files->set_custom_minimum_size(Size2(0, 200) * EDSCALE); find_in_files->set_custom_minimum_size(Size2(0, 200) * EDSCALE);
find_in_files->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, this, "_on_find_in_files_result_selected"); find_in_files->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, this, "_on_find_in_files_result_selected");
find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, this, "_on_find_in_files_modified_files"); find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, this, "_on_find_in_files_modified_files");