Skip to content

Commit

Permalink
KBShortcutsDialog: fixed shortcuts for "Preferences" and "Show/Hide 3…
Browse files Browse the repository at this point in the history
…Dconnexion 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"
  • Loading branch information
YuSanka committed May 5, 2021
1 parent 51aa26e commit 6efeb9d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/slic3r/GUI/KBShortcutsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
};
Expand Down Expand Up @@ -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.
Expand All @@ -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 });
Expand Down

0 comments on commit 6efeb9d

Please sign in to comment.