From 6efeb9d6b433f49aaca8ee42ed02d824c452eb8e Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 5 May 2021 09:42:10 +0200 Subject: [PATCH] KBShortcutsDialog: fixed shortcuts for "Preferences" and "Show/Hide 3Dconnexion devices settings dialog, if enabled" under osx and "Set Printable/Unprintable" and "Set extruder" under Linux + OSX specific: Added minimize of the application on "Cmd+M" --- src/slic3r/GUI/GLCanvas3D.cpp | 10 ++++++++++ src/slic3r/GUI/KBShortcutsDialog.cpp | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 6dcd30c2913..8abff9fdb51 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2519,9 +2519,19 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) #ifdef _WIN32 if (wxGetApp().app_config->get("use_legacy_3DConnexion") == "1") { #endif //_WIN32 +#ifdef __APPLE__ + // On OSX use Cmd+Shift+M to "Show/Hide 3Dconnexion devices settings dialog" + if ((evt.GetModifiers() & shiftMask) != 0) { +#endif // __APPLE__ Mouse3DController& controller = wxGetApp().plater()->get_mouse3d_controller(); controller.show_settings_dialog(!controller.is_settings_dialog_shown()); m_dirty = true; +#ifdef __APPLE__ + } + else + // and Cmd+M to minimize application + wxGetApp().mainframe->Iconize(); +#endif // __APPLE__ #ifdef _WIN32 } #endif //_WIN32 diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 670a709928e..08a30c64fe7 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -109,7 +109,11 @@ void KBShortcutsDialog::fill_shortcuts() { "0-6", L("Camera view") }, { "E", L("Show/Hide object/instance labels") }, // Configuration +#ifdef __APPLE__ + { ctrl + ",", L("Preferences") }, +#else { ctrl + "P", L("Preferences") }, +#endif // Help { "?", L("Show keyboard shortcuts list") } }; @@ -149,8 +153,13 @@ void KBShortcutsDialog::fill_shortcuts() { "Shift+Tab", L("Collapse/Expand the sidebar") }, #ifdef _WIN32 { ctrl + "M", L("Show/Hide 3Dconnexion devices settings dialog, if enabled") }, +#else +#ifdef __APPLE__ + { ctrl + shift + "M", L("Show/Hide 3Dconnexion devices settings dialog") }, + { ctrl + "M", L("Minimize application") }, #else { ctrl + "M", L("Show/Hide 3Dconnexion devices settings dialog") }, +#endif // __APPLE__ #endif // _WIN32 #if ENABLE_RENDER_PICKING_PASS // Don't localize debugging texts. @@ -173,9 +182,15 @@ void KBShortcutsDialog::fill_shortcuts() m_full_shortcuts.push_back({ { _L("Gizmos"), _L("The following shortcuts are applicable when the specified gizmo is active") }, gizmos_shortcuts }); Shortcuts object_list_shortcuts = { +#if defined (__linux__) + { alt + "P", L("Set selected items as Ptrintable/Unprintable") }, + { alt + "0", L("Set default extruder for the selected items") }, + { alt + "1-9", L("Set extruder number for the selected items") }, +#else { "P", L("Set selected items as Ptrintable/Unprintable") }, { "0", L("Set default extruder for the selected items") }, { "1-9", L("Set extruder number for the selected items") }, +#endif }; m_full_shortcuts.push_back({ { _L("Objects List"), "" }, object_list_shortcuts });