From 489fba326ee6732955312e31633ccb8e47872d95 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 22 Jun 2019 17:39:09 +0200 Subject: [PATCH] Add 'L' as a legend toggle shortcut in preview --- src/slic3r/GUI/GUI_Preview.cpp | 5 +++++ src/slic3r/GUI/KBShortcutsDialog.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index c26c29187..64218d08f 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -718,6 +718,11 @@ void Preview::update_double_slider_from_canvas(wxKeyEvent& event) m_slider->SetHigherValue(new_pos); if (event.ShiftDown() || m_slider->is_one_layer()) m_slider->SetLowerValue(m_slider->GetHigherValue()); } + else if (key == 'L') { + m_checkbox_legend->SetValue(!m_checkbox_legend->GetValue()); + auto evt = wxCommandEvent(); + on_checkbox_legend(evt); + } else if (key == 'S') m_slider->ChangeOneLayerLock(); else diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 38d02a98a..08d46444c 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -178,6 +178,7 @@ void KBShortcutsDialog::fill_shortcuts() preview_shortcuts.push_back(Shortcut(L("Arrow Down"), L("Lower Layer"))); preview_shortcuts.push_back(Shortcut("U", L("Upper Layer"))); preview_shortcuts.push_back(Shortcut("D", L("Lower Layer"))); + preview_shortcuts.push_back(Shortcut("L", L("Show/Hide (L)egend"))); m_full_shortcuts.push_back(std::make_pair(_(L("Preview Shortcuts")), std::make_pair(preview_shortcuts, szLeft)));