mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
toggle printability of selection with keyboard shortcut (#13279)
* toggle printability of object with keyboard shortcut * add localization for toggle shortcut
This commit is contained in:
@@ -1047,6 +1047,8 @@ wxDEFINE_EVENT(EVT_CUSTOMEVT_TICKSCHANGED, wxCommandEvent);
|
||||
wxDEFINE_EVENT(EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE, SimpleEvent);
|
||||
wxDEFINE_EVENT(EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE, Event<float>);
|
||||
wxDEFINE_EVENT(EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, HeightProfileSmoothEvent);
|
||||
wxDEFINE_EVENT(EVT_GLCANVAS_PRINTABLE, SimpleEvent);
|
||||
|
||||
|
||||
const double GLCanvas3D::DefaultCameraZoomToBoxMarginFactor = 1.25;
|
||||
const double GLCanvas3D::DefaultCameraZoomToBedMarginFactor = 2.00;
|
||||
@@ -3489,6 +3491,8 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
||||
// }
|
||||
// break;
|
||||
//}
|
||||
case 'v':
|
||||
case 'V': { post_event(SimpleEvent(EVT_GLCANVAS_PRINTABLE)); break; }
|
||||
default: { evt.Skip(); break; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ wxDECLARE_EVENT(EVT_CUSTOMEVT_TICKSCHANGED, wxCommandEvent);
|
||||
wxDECLARE_EVENT(EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE, SimpleEvent);
|
||||
wxDECLARE_EVENT(EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE, Event<float>);
|
||||
wxDECLARE_EVENT(EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, HeightProfileSmoothEvent);
|
||||
wxDECLARE_EVENT(EVT_GLCANVAS_PRINTABLE, SimpleEvent);
|
||||
|
||||
class GLCanvas3D
|
||||
{
|
||||
|
||||
@@ -827,7 +827,7 @@ void MenuFactory::append_menu_item_fill_bed(wxMenu *menu)
|
||||
wxMenuItem* MenuFactory::append_menu_item_printable(wxMenu* menu)
|
||||
{
|
||||
// BBS: to be checked
|
||||
wxMenuItem* menu_item_printable = append_menu_check_item(menu, wxID_ANY, _L("Printable"), "",
|
||||
wxMenuItem* menu_item_printable = append_menu_check_item(menu, wxID_ANY, _L("Printable") + "\t" + "V", "",
|
||||
[](wxCommandEvent&) { obj_list()->toggle_printable_state(); }, menu);
|
||||
|
||||
m_parent->Bind(wxEVT_UPDATE_UI, [](wxUpdateUIEvent& evt) {
|
||||
@@ -2222,8 +2222,7 @@ void MenuFactory::append_menu_item_set_printable(wxMenu* menu)
|
||||
}
|
||||
}
|
||||
|
||||
wxString menu_text = _L("Printable");
|
||||
wxMenuItem* menu_item_set_printable = append_menu_check_item(menu, wxID_ANY, menu_text, "", [this, all_printable](wxCommandEvent&) {
|
||||
wxMenuItem* menu_item_set_printable = append_menu_check_item(menu, wxID_ANY, _L("Printable") + "\t" + "V", "", [this, all_printable](wxCommandEvent&) {
|
||||
Selection& selection = plater()->canvas3D()->get_selection();
|
||||
selection.set_printable(!all_printable);
|
||||
}, menu);
|
||||
|
||||
@@ -259,6 +259,7 @@ void KBShortcutsDialog::fill_shortcuts()
|
||||
{ "E", L("Gizmo brim ears") },
|
||||
{ "I", L("Zoom in") },
|
||||
{ "O", L("Zoom out") },
|
||||
{ "V", L("Toggle printable for object/part") },
|
||||
{ L("Tab"), L("Switch between Prepare/Preview") },
|
||||
|
||||
};
|
||||
|
||||
@@ -5106,7 +5106,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
this->q->set_prepare_state(Job::PREPARE_STATE_MENU);
|
||||
this->q->orient(); });
|
||||
//BBS
|
||||
view3D_canvas->Bind(EVT_GLCANVAS_SELECT_CURR_PLATE_ALL, [this](SimpleEvent&) {this->q->select_curr_plate_all(); });
|
||||
view3D_canvas->Bind(EVT_GLCANVAS_SELECT_CURR_PLATE_ALL, [this](SimpleEvent&) {this->q->select_curr_plate_all(); });
|
||||
view3D_canvas->Bind(EVT_GLCANVAS_PRINTABLE, [this](SimpleEvent& evt) { this->sidebar->obj_list()->toggle_printable_state(); });
|
||||
|
||||
view3D_canvas->Bind(EVT_GLCANVAS_SELECT_ALL, [this](SimpleEvent&) { this->q->select_all(); });
|
||||
view3D_canvas->Bind(EVT_GLCANVAS_QUESTION_MARK, [](SimpleEvent&) { wxGetApp().keyboard_shortcuts(); });
|
||||
|
||||
Reference in New Issue
Block a user