Tab shortcut key to switch between prepare/preview tab

#383

(cherry picked from commit 93f3d8b0cecaa13fa3f3ab5fc483cfb8ac4852c4)
This commit is contained in:
SoftFever 2023-03-05 01:34:36 +08:00
parent d535d70d03
commit 2131c658d8
4 changed files with 13 additions and 9 deletions

View file

@ -3278,7 +3278,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
else if (m_tab_down && keyCode == WXK_TAB && !evt.HasAnyModifiers()) {
// Enable switching between 3D and Preview with Tab
// m_canvas->HandleAsNavigationKey(evt); // XXX: Doesn't work in some cases / on Linux
//post_event(SimpleEvent(EVT_GLCANVAS_TAB));
post_event(SimpleEvent(EVT_GLCANVAS_TAB));
}
else if (keyCode == WXK_TAB && evt.ShiftDown() && !evt.ControlDown() && ! wxGetApp().is_gcode_viewer()) {
// Collapse side-panel with Shift+Tab

View file

@ -245,6 +245,7 @@ void KBShortcutsDialog::fill_shortcuts()
{ "F", L("Gizmo Place face on bed") },
{ "L", L("Gizmo SLA support points") },
{ "P", L("Gizmo FDM paint-on seam") },
{ "Tab", L("Swtich between Prepare/Prewview") },
};
m_full_shortcuts.push_back({ { _L("Plater"), "" }, plater_shortcuts });
@ -285,6 +286,8 @@ void KBShortcutsDialog::fill_shortcuts()
{ L("Arrow Left"), L("Horizontal slider - Move active thumb Left")},
{ L("Arrow Right"), L("Horizontal slider - Move active thumb Right")},
{ "L", L("On/Off one layer mode of the vertical slider")},
{ "C", L("On/Off g-code window")},
{ "Tab", L("Swtich between Prepare/Prewview") },
{L("Shift+Any arrow"), L("Move slider 5x faster")},
{L("Shift+Mouse wheel"), L("Move slider 5x faster")},
#ifdef __APPLE__

View file

@ -321,10 +321,10 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
});
//BBS
Bind(EVT_SELECT_TAB, [this](wxCommandEvent&evt) {
TabPosition pos = (TabPosition)evt.GetInt();
m_tabpanel->SetSelection(pos);
});
// Bind(EVT_SELECT_TAB, [this](wxCommandEvent&evt) {
// TabPosition pos = (TabPosition)evt.GetInt();
// m_tabpanel->SetSelection(pos);
// });
Bind(EVT_SYNC_CLOUD_PRESET, &MainFrame::on_select_default_preset, this);

View file

@ -2828,12 +2828,13 @@ void Plater::priv::select_view_3D(const std::string& name, bool no_slice)
void Plater::priv::select_next_view_3D()
{
if (current_panel == view3D)
set_current_panel(preview);
wxGetApp().mainframe->select_tab(size_t(MainFrame::tpPreview));
else if (current_panel == preview)
set_current_panel(assemble_view);
else if (current_panel == assemble_view)
set_current_panel(view3D);
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
// else if (current_panel == assemble_view)
// set_current_panel(view3D);
}
void Plater::priv::collapse_sidebar(bool collapse)