From 914425e52675423a6e692c9c78623cdb05e779b5 Mon Sep 17 00:00:00 2001 From: Alexandre Folle de Menezes Date: Tue, 9 Sep 2025 10:48:42 -0300 Subject: [PATCH] Update strings for keyboard shortcuts (#10399) * Update strings for keyboard shortcuts --- src/slic3r/GUI/GLCanvas3D.cpp | 15 ++-- src/slic3r/GUI/GUI.cpp | 6 +- src/slic3r/GUI/GUI_Factories.cpp | 3 +- src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp | 10 ++- src/slic3r/GUI/Gizmos/GLGizmoCut.cpp | 2 +- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 16 +++-- src/slic3r/GUI/Gizmos/GLGizmoFuzzySkin.cpp | 14 ++-- src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp | 4 +- .../GUI/Gizmos/GLGizmoMmuSegmentation.cpp | 20 ++++-- src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp | 12 +++- src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 11 +-- src/slic3r/GUI/Gizmos/GLGizmoText.cpp | 2 +- .../GUI/Gizmos/GizmoObjectManipulation.cpp | 3 +- src/slic3r/GUI/KBShortcutsDialog.cpp | 69 +++++++------------ src/slic3r/GUI/MainFrame.cpp | 40 +++++------ src/slic3r/GUI/ModelMall.cpp | 10 +-- src/slic3r/GUI/ParamsPanel.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 2 +- 20 files changed, 128 insertions(+), 117 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 3585c411b9..30cf0ad3fd 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -302,10 +302,10 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(const GLCanv float get_cur_y = ImGui::GetContentRegionMax().y + ImGui::GetFrameHeight() + canvas.m_main_toolbar.get_height(); std::map captions_texts = { - {_L("Left mouse button:") ,_L("Add detail")}, - {_L("Right mouse button:"), _L("Remove detail")}, - {_L("Shift + Left mouse button:"),_L("Reset to base")}, - {_L("Shift + Right mouse button:"), _L("Smoothing")}, + {_L("Left mouse button") + ":" , _L("Add detail")}, + {_L("Right mouse button") + ":", _L("Remove detail")}, + {_L("Shift+") + _L("Left mouse button") + ":", _L("Reset to base")}, + {_L("Shift+") + _L("Right mouse button") + ":", _L("Smoothing")}, {_L("Mouse wheel:"), _L("Increase/decrease edit area")} }; show_tooltip_information(canvas, captions_texts, x, get_cur_y); @@ -1170,7 +1170,8 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D &bed) m_assembly_view_desc["object_selection_caption"] = _L("Left mouse button"); m_assembly_view_desc["object_selection"] = _L("object selection"); - m_assembly_view_desc["part_selection_caption"] = "Alt +" + _L("Left mouse button"); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + m_assembly_view_desc["part_selection_caption"] = _L("Alt+") + _L("Left mouse button"); m_assembly_view_desc["part_selection"] = _L("part selection"); m_assembly_view_desc["number_key_caption"] = "1~16 " + _L("number keys"); m_assembly_view_desc["number_key"] = _L("number keys can quickly change the color of objects"); @@ -6469,7 +6470,7 @@ bool GLCanvas3D::_init_main_toolbar() item.name = "orient"; item.icon_filename = m_is_dark ? "toolbar_orient_dark.svg" : "toolbar_orient.svg"; - item.tooltip = _utf8(L("Auto orient all/selected objects")) + " [Q]\n" + _utf8(L("Auto orient all objects on current plate")) + " [Shift+Q]"; + item.tooltip = _utf8(L("Auto orient all/selected objects")) + " [Q]\n" + _utf8(L("Auto orient all objects on current plate")) + " [" + _utf8(L("Shift+")) + "Q]"; item.sprite_id++; item.left.render_callback = nullptr; item.enabling_callback = []()->bool { return wxGetApp().plater()->can_arrange(); }; @@ -6491,7 +6492,7 @@ bool GLCanvas3D::_init_main_toolbar() item.name = "arrange"; item.icon_filename = m_is_dark ? "toolbar_arrange_dark.svg" : "toolbar_arrange.svg"; - item.tooltip = _utf8(L("Arrange all objects")) + " [A]\n" + _utf8(L("Arrange objects on selected plates")) + " [Shift+A]"; + item.tooltip = _utf8(L("Arrange all objects")) + " [A]\n" + _utf8(L("Arrange objects on selected plates")) + " [" + _utf8(L("Shift+")) + "A]"; item.sprite_id++; item.left.action_callback = []() {}; item.enabling_callback = []()->bool { return wxGetApp().plater()->can_arrange(); }; diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 715512ced4..b4da0fecf1 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -82,7 +82,7 @@ const std::string& shortkey_ctrl_prefix() { static const std::string str = #ifdef __APPLE__ - "⌘+" + u8"\u2318+" // "⌘+" (Mac Command+) #else _u8L("Ctrl+") #endif @@ -94,9 +94,9 @@ const std::string& shortkey_alt_prefix() { static const std::string str = #ifdef __APPLE__ - "⌥+" + u8"\u2325+" // "⌥+" (Mac Option+) #else - "Alt+" + _u8L("Alt+") #endif ; return str; diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index ac9ce3b4b4..c59a217408 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -489,7 +489,7 @@ void MenuFactory::append_menu_item_delete(wxMenu* menu) [](wxCommandEvent&) { plater()->remove_selected(); }, "menu_delete", nullptr, []() { return plater()->can_delete(); }, m_parent); #else - append_menu_item(menu, wxID_ANY, _L("Delete") + "\tBackSpace", _L("Delete the selected object"), + append_menu_item(menu, wxID_ANY, _L("Delete") + "\t" + _L("Backspace"), _L("Delete the selected object"), [](wxCommandEvent&) { plater()->remove_selected(); }, "", nullptr, []() { return plater()->can_delete(); }, m_parent); #endif @@ -1792,6 +1792,7 @@ void MenuFactory::append_menu_item_clone(wxMenu* menu) #ifdef __APPLE__ static const wxString ctrl = ("Ctrl+"); #else + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? static const wxString ctrl = _L("Ctrl+"); #endif append_menu_item(menu, wxID_ANY, _L("Clone") + "\t" + ctrl + "K", "", diff --git a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp index 35cc3c7700..21944ecb95 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoAdvancedCut.cpp @@ -357,7 +357,7 @@ bool GLGizmoAdvancedCut::on_init() // initiate info shortcuts const wxString ctrl = GUI::shortkey_ctrl_prefix(); const wxString alt = GUI::shortkey_alt_prefix(); - const wxString shift = "Shift+"; + const wxString shift = _L("Shift+"); m_shortcuts.push_back(std::make_pair(_L("Left click"), _L("Add connector"))); m_shortcuts.push_back(std::make_pair(_L("Right click"), _L("Remove connector"))); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp b/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp index 2b7e7bc9fe..cda8e1e09c 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBrimEars.cpp @@ -40,11 +40,15 @@ GLGizmoBrimEars::GLGizmoBrimEars(GLCanvas3D &parent, const std::string &icon_fil bool GLGizmoBrimEars::on_init() { - m_new_point_head_diameter = get_brim_default_radius(); m_shortcut_key = WXK_CONTROL_E; + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? + const wxString ctrl = _L("Ctrl+"); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + const wxString alt = _L("Alt+"); + m_desc["head_diameter"] = _L("Head diameter"); m_desc["max_angle"] = _L("Max angle"); m_desc["detection_radius"] = _L("Detection radius"); @@ -57,9 +61,9 @@ bool GLGizmoBrimEars::on_init() m_desc["left_click"] = _L("Add a brim ear"); m_desc["right_click_caption"] = _L("Right click"); m_desc["right_click"] = _L("Delete a brim ear"); - m_desc["ctrl_mouse_wheel_caption"] = _L("Ctrl+Mouse wheel"); + m_desc["ctrl_mouse_wheel_caption"] = ctrl + _L("Mouse wheel"); m_desc["ctrl_mouse_wheel"] = _L("Adjust head diameter"); - m_desc["alt_mouse_wheel_caption"] = _L("Alt + Mouse wheel"); + m_desc["alt_mouse_wheel_caption"] = alt + _L("Mouse wheel"); m_desc["alt_mouse_wheel"] = _L("Adjust section view"); return true; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp index a2e0df35b3..e0c24dc87f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp @@ -1183,7 +1183,7 @@ bool GLGizmoCut3D::on_init() // initiate info shortcuts const wxString ctrl = GUI::shortkey_ctrl_prefix(); const wxString alt = GUI::shortkey_alt_prefix(); - const wxString shift = "Shift+"; + const wxString shift = _L("Shift+"); m_shortcuts_cut.push_back(std::make_pair(shift + _L("Drag"), _L("Draw cut line"))); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 3c831aa98c..f216c444a3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -79,25 +79,31 @@ bool GLGizmoFdmSupports::on_init() // BBS m_shortcut_key = WXK_CONTROL_L; - m_desc["clipping_of_view_caption"] = _L("Alt + Mouse wheel"); + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? + const wxString ctrl = _L("Ctrl+"); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + const wxString alt = _L("Alt+"); + const wxString shift = _L("Shift+"); + + m_desc["clipping_of_view_caption"] = alt + _L("Mouse wheel"); m_desc["clipping_of_view"] = _L("Section view"); m_desc["reset_direction"] = _L("Reset direction"); - m_desc["cursor_size_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["cursor_size_caption"] = ctrl + _L("Mouse wheel"); m_desc["cursor_size"] = _L("Pen size"); m_desc["enforce_caption"] = _L("Left mouse button"); m_desc["enforce"] = _L("Enforce supports"); m_desc["block_caption"] = _L("Right mouse button"); m_desc["block"] = _L("Block supports"); - m_desc["remove_caption"] = _L("Shift + Left mouse button"); + m_desc["remove_caption"] = shift + _L("Left mouse button"); m_desc["remove"] = _L("Erase"); m_desc["remove_all"] = _L("Erase all painting"); m_desc["highlight_by_angle"] = _L("Highlight overhang areas"); m_desc["gap_fill"] = _L("Gap fill"); m_desc["perform"] = _L("Perform"); - m_desc["gap_area_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["gap_area_caption"] = ctrl + _L("Mouse wheel"); m_desc["gap_area"] = _L("Gap area"); m_desc["tool_type"] = _L("Tool type"); - m_desc["smart_fill_angle_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["smart_fill_angle_caption"] = ctrl + _L("Mouse wheel"); m_desc["smart_fill_angle"] = _L("Smart fill angle"); m_desc["on_overhangs_only"] = _L("On overhangs only"); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFuzzySkin.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFuzzySkin.cpp index 49d8008df4..ec0883d8a9 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFuzzySkin.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFuzzySkin.cpp @@ -31,15 +31,21 @@ bool GLGizmoFuzzySkin::on_init() { m_shortcut_key = WXK_CONTROL_H; - m_desc["clipping_of_view_caption"] = _L("Alt + Mouse wheel"); + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? + const wxString ctrl = _L("Ctrl+"); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + const wxString alt = _L("Alt+"); + const wxString shift = _L("Shift+"); + + m_desc["clipping_of_view_caption"] = alt + _L("Mouse wheel"); m_desc["clipping_of_view"] = _L("Section view"); m_desc["reset_direction"] = _L("Reset direction"); - m_desc["cursor_size_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["cursor_size_caption"] = ctrl + _L("Mouse wheel"); m_desc["cursor_size"] = _L("Brush size"); m_desc["cursor_type"] = _L("Brush shape") ; m_desc["add_fuzzy_skin_caption"] = _L("Left mouse button"); m_desc["add_fuzzy_skin"] = _L("Add fuzzy skin"); - m_desc["remove_fuzzy_skin_caption"] = _L("Shift + Left mouse button"); + m_desc["remove_fuzzy_skin_caption"] = shift + _L("Left mouse button"); m_desc["remove_fuzzy_skin"] = _L("Remove fuzzy skin"); m_desc["remove_all"] = _L("Erase all painting"); m_desc["circle"] = _L("Circle"); @@ -48,7 +54,7 @@ bool GLGizmoFuzzySkin::on_init() m_desc["tool_type"] = _L("Tool type"); m_desc["tool_brush"] = _L("Brush"); m_desc["tool_smart_fill"] = _L("Smart fill"); - m_desc["smart_fill_angle_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["smart_fill_angle_caption"] = ctrl + _L("Mouse wheel"); m_desc["smart_fill_angle"] = _L("Smart fill angle"); return true; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 299e4da3d9..a6be7afee6 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -444,8 +444,10 @@ bool GLGizmoMeasure::on_init() { m_shortcut_key = WXK_CONTROL_U; + const wxString shift = _L("Shift+"); + m_desc["feature_selection"] = _L("Select feature"); - m_desc["point_selection_caption"] = _L("Shift + Left mouse button"); + m_desc["point_selection_caption"] = shift + _L("Left mouse button"); m_desc["point_selection"] = _L("Select point"); m_desc["reset_caption"] = _L("Delete"); m_desc["reset"] = _L("Restart selection"); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index 4e216bd81c..9dfd36f56a 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -103,21 +103,27 @@ bool GLGizmoMmuSegmentation::on_init() // BBS m_shortcut_key = WXK_CONTROL_N; - m_desc["clipping_of_view_caption"] = _L("Alt + Mouse wheel"); + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? + const wxString ctrl = _L("Ctrl+"); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + const wxString alt = _L("Alt+"); + const wxString shift = _L("Shift+"); + + m_desc["clipping_of_view_caption"] = alt + _L("Mouse wheel"); m_desc["clipping_of_view"] = _L("Section view"); m_desc["reset_direction"] = _L("Reset direction"); - m_desc["cursor_size_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["cursor_size_caption"] = ctrl + _L("Mouse wheel"); m_desc["cursor_size"] = _L("Pen size"); m_desc["cursor_type"] = _L("Pen shape"); m_desc["paint_caption"] = _L("Left mouse button"); m_desc["paint"] = _L("Paint"); - m_desc["erase_caption"] = _L("Shift + Left mouse button"); + m_desc["erase_caption"] = shift + _L("Left mouse button"); m_desc["erase"] = _L("Erase"); m_desc["shortcut_key_caption"] = _L("Key 1~9"); m_desc["shortcut_key"] = _L("Choose filament"); m_desc["edge_detection"] = _L("Edge detection"); - m_desc["gap_area_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["gap_area_caption"] = ctrl + _L("Mouse wheel"); m_desc["gap_area"] = _L("Gap area"); m_desc["perform"] = _L("Perform"); @@ -132,14 +138,14 @@ bool GLGizmoMmuSegmentation::on_init() m_desc["tool_smart_fill"] = _L("Smart fill"); m_desc["tool_bucket_fill"] = _L("Bucket fill"); - m_desc["smart_fill_angle_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["smart_fill_angle_caption"] = ctrl + _L("Mouse wheel"); m_desc["smart_fill_angle"] = _L("Smart fill angle"); - m_desc["height_range_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["height_range_caption"] = ctrl + _L("Mouse wheel"); m_desc["height_range"] = _L("Height range"); //add toggle wire frame hint - m_desc["toggle_wireframe_caption"] = _L("Alt + Shift + Enter"); + m_desc["toggle_wireframe_caption"] = alt + shift + _L("Enter"); m_desc["toggle_wireframe"] = _L("Toggle Wireframe"); // Filament remapping descriptions diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp index 19f4efb9f6..6a8317e132 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSeam.cpp @@ -29,17 +29,23 @@ bool GLGizmoSeam::on_init() { m_shortcut_key = WXK_CONTROL_P; - m_desc["clipping_of_view_caption"] = _L("Alt + Mouse wheel"); + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? + const wxString ctrl = _L("Ctrl+"); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + const wxString alt = _L("Alt+"); + const wxString shift = _L("Shift+"); + + m_desc["clipping_of_view_caption"] = alt + _L("Mouse wheel"); m_desc["clipping_of_view"] = _L("Section view"); m_desc["reset_direction"] = _L("Reset direction"); - m_desc["cursor_size_caption"] = _L("Ctrl + Mouse wheel"); + m_desc["cursor_size_caption"] = ctrl + _L("Mouse wheel"); m_desc["cursor_size"] = _L("Brush size"); m_desc["cursor_type"] = _L("Brush shape"); m_desc["enforce_caption"] = _L("Left mouse button"); m_desc["enforce"] = _L("Enforce seam"); m_desc["block_caption"] = _L("Right mouse button"); m_desc["block"] = _L("Block seam"); - m_desc["remove_caption"] = _L("Shift + Left mouse button"); + m_desc["remove_caption"] = shift + _L("Left mouse button"); m_desc["remove"] = _L("Erase"); m_desc["remove_all"] = _L("Erase all painting"); m_desc["circle"] = _L("Circle"); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp index ef46c7d002..00c78df2ab 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp @@ -1175,9 +1175,10 @@ SlaGizmoHelpDialog::SlaGizmoHelpDialog() : wxDialog(nullptr, wxID_ANY, _L("SLA gizmo keyboard shortcuts"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); + const wxString ctrl = GUI::shortkey_ctrl_prefix(); const wxString alt = GUI::shortkey_alt_prefix(); - + const wxString shift = _L("Shift+"); // fonts const wxFont& font = wxGetApp().small_font(); @@ -1206,14 +1207,14 @@ SlaGizmoHelpDialog::SlaGizmoHelpDialog() shortcuts.push_back(std::make_pair(_L("Drag"), _L("Move point"))); shortcuts.push_back(std::make_pair(ctrl+_L("Left click"), _L("Add point to selection"))); shortcuts.push_back(std::make_pair(alt+_L("Left click"), _L("Remove point from selection"))); - shortcuts.push_back(std::make_pair(wxString("Shift+")+_L("Drag"), _L("Select by rectangle"))); + shortcuts.push_back(std::make_pair(shift+_L("Drag"), _L("Select by rectangle"))); shortcuts.push_back(std::make_pair(alt+_(L("Drag")), _L("Deselect by rectangle"))); shortcuts.push_back(std::make_pair(ctrl+"A", _L("Select all points"))); - shortcuts.push_back(std::make_pair("Delete", _L("Remove selected points"))); + shortcuts.push_back(std::make_pair(_L"Del", _L("Remove selected points"))); shortcuts.push_back(std::make_pair(ctrl+_L("Mouse wheel"), _L("Move clipping plane"))); shortcuts.push_back(std::make_pair("R", _L("Reset clipping plane"))); - shortcuts.push_back(std::make_pair("Enter", _L("Apply changes"))); - shortcuts.push_back(std::make_pair("Esc", _L("Discard changes"))); + shortcuts.push_back(std::make_pair(_L("Enter"), _L("Apply changes"))); + shortcuts.push_back(std::make_pair(_L("Esc"), _L("Discard changes"))); shortcuts.push_back(std::make_pair("M", _L("Switch to editing mode"))); shortcuts.push_back(std::make_pair("A", _L("Auto-generate points"))); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp index 8717e8571d..865f12c9dd 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp @@ -278,7 +278,7 @@ bool GLGizmoText::on_init() m_desc["surface"] = _L("Surface"); m_desc["horizontal_text"] = _L("Horizontal text"); - m_desc["rotate_text_caption"] = _L("Shift + Mouse move up or down"); + m_desc["rotate_text_caption"] = _L("Shift+") + _L("Mouse move up or down"); m_desc["rotate_text"] = _L("Rotate text"); return true; diff --git a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp index d5f25146ba..3e27bd8cb3 100644 --- a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp +++ b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp @@ -55,9 +55,10 @@ GizmoObjectManipulation::GizmoObjectManipulation(GLCanvas3D& glcanvas) m_imperial_units = wxGetApp().app_config->get("use_inches") == "1"; m_new_unit_string = m_imperial_units ? L("in") : L("mm"); - const wxString shift = "Shift+"; + const wxString shift = _L("Shift+"); const wxString alt = GUI::shortkey_alt_prefix(); const wxString ctrl = GUI::shortkey_ctrl_prefix(); + m_desc_move["part_selection_caption"] = alt + _L("Left mouse button"); m_desc_move["part_selection"] = _L("Part selection"); m_desc_move["snap_step_caption"] = shift + _L("Left mouse button"); diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 58ed58758f..42898270e4 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -163,8 +163,9 @@ void KBShortcutsDialog::on_dpi_changed(const wxRect& suggested_rect) void KBShortcutsDialog::fill_shortcuts() { - const std::string& ctrl = GUI::shortkey_ctrl_prefix(); - const std::string& alt = GUI::shortkey_alt_prefix(); + const std::string ctrl = GUI::shortkey_ctrl_prefix(); + const std::string alt = GUI::shortkey_alt_prefix(); + const std::string shift = L("Shift+"); if (wxGetApp().is_editor()) { Shortcuts global_shortcuts = { @@ -172,7 +173,7 @@ void KBShortcutsDialog::fill_shortcuts() { ctrl + "N", L("New Project") }, { ctrl + "O", L("Open Project") }, { ctrl + "S", L("Save Project") }, - { ctrl + "Shift+S", L("Save Project as")}, + { ctrl + shift + "S", L("Save Project as")}, // File>Import { ctrl + "I", L("Import geometry data from STL/STEP/3MF/OBJ/AMF files") }, // File>Export @@ -180,12 +181,7 @@ void KBShortcutsDialog::fill_shortcuts() // Slice plate { ctrl + "R", L("Slice plate")}, // Send to Print -#ifdef __APPLE__ - { L("⌘+Shift+G"), L("Print plate")}, -#else - { L("Ctrl+Shift+G"), L("Print plate")}, -#endif // __APPLE - + { ctrl + shift + "G", L("Print plate")}, // Edit { ctrl + "X", L("Cut") }, { ctrl + "C", L("Copy to clipboard") }, @@ -194,13 +190,13 @@ void KBShortcutsDialog::fill_shortcuts() { ctrl + "P", L("Preferences") }, //3D control #ifdef __APPLE__ - { ctrl + "Shift+M", L("Show/Hide 3Dconnexion devices settings dialog") }, + { ctrl + shift + "M", L("Show/Hide 3Dconnexion devices settings dialog") }, #else { ctrl + "M", L("Show/Hide 3Dconnexion devices settings dialog") }, #endif // __APPLE // Switch table page - { ctrl + "Tab", L("Switch table page")}, + { ctrl + L("Tab"), L("Switch table page")}, //DEL #ifdef __APPLE__ {"fn+⌫", L("Delete selected")}, @@ -217,28 +213,21 @@ void KBShortcutsDialog::fill_shortcuts() { L("Right mouse button"), L("Pan View") }, { L("Mouse wheel"), L("Zoom View") }, { "A", L("Arrange all objects") }, - { L("Shift+A"), L("Arrange objects on selected plates") }, + { shift + "A", L("Arrange objects on selected plates") }, { "Q", L("Auto orients selected objects or all objects. If there are selected objects, it just orients the selected ones. Otherwise, it will orient all objects in the current project.") }, - {L("Shift+Q"), L("Auto orients all objects on the active plate.")}, + { shift + "Q", L("Auto orients all objects on the active plate.") }, - {L("Shift+Tab"), L("Collapse/Expand the sidebar")}, - #ifdef __APPLE__ - {L("⌘+Any arrow"), L("Movement in camera space")}, - {L("⌥+Left mouse button"), L("Select a part")}, - {L("⌘+Left mouse button"), L("Select multiple objects")}, - #else - {L("Ctrl+Any arrow"), L("Movement in camera space")}, - {L("Alt+Left mouse button"), L("Select a part")}, - {L("Ctrl+Left mouse button"), L("Select multiple objects")}, - - #endif - {L("Shift+Left mouse button"), L("Select objects by rectangle")}, + {shift + L("Tab"), L("Collapse/Expand the sidebar")}, + {ctrl + L("Any arrow"), L("Movement in camera space")}, + {alt + L("Left mouse button"), L("Select a part")}, + {ctrl + L("Left mouse button"), L("Select multiple objects")}, + {shift + L("Left mouse button"), L("Select objects by rectangle")}, {L("Arrow Up"), L("Move selection 10 mm in positive Y direction")}, {L("Arrow Down"), L("Move selection 10 mm in negative Y direction")}, {L("Arrow Left"), L("Move selection 10 mm in negative X direction")}, {L("Arrow Right"), L("Move selection 10 mm in positive X direction")}, - {L("Shift+Any arrow"), L("Movement step set to 1 mm")}, + {shift + L("Any arrow"), L("Movement step set to 1 mm")}, {L("Esc"), L("Deselect all")}, {"1-9", L("keyboard 1-9: set filament for object/part")}, {ctrl + "0", L("Camera view - Default")}, @@ -268,21 +257,16 @@ void KBShortcutsDialog::fill_shortcuts() { "E", L("Gizmo brim ears") }, { "I", L("Zoom in") }, { "O", L("Zoom out") }, - { "Tab", L("Switch between Prepare/Preview") }, + { L("Tab"), L("Switch between Prepare/Preview") }, }; m_full_shortcuts.push_back({ { _L("Plater"), "" }, plater_shortcuts }); Shortcuts gizmos_shortcuts = { {L("Esc"), L("Deselect all")}, - {L("Shift+"), L("Move: press to snap by 1mm")}, - #ifdef __APPLE__ - {L("⌘+Mouse wheel"), L("Support/Color Painting: adjust pen radius")}, - {L("⌥+Mouse wheel"), L("Support/Color Painting: adjust section position")}, - #else - {L("Ctrl+Mouse wheel"), L("Support/Color Painting: adjust pen radius")}, - {L("Alt+Mouse wheel"), L("Support/Color Painting: adjust section position")}, - #endif + {shift, L("Move: press to snap by 1mm")}, + {ctrl + L("Mouse wheel"), L("Support/Color Painting: adjust pen radius")}, + {alt + L("Mouse wheel"), L("Support/Color Painting: adjust section position")}, }; m_full_shortcuts.push_back({{_L("Gizmo"), ""}, gizmos_shortcuts}); @@ -310,16 +294,11 @@ void KBShortcutsDialog::fill_shortcuts() { 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("Switch between Prepare/Preview") }, - {L("Shift+Any arrow"), L("Move slider 5x faster")}, - {L("Shift+Mouse wheel"), L("Move slider 5x faster")}, - #ifdef __APPLE__ - {L("⌘+Any arrow"), L("Move slider 5x faster")}, - {L("⌘+Mouse wheel"), L("Move slider 5x faster")}, - #else - {L("Ctrl+Any arrow"), L("Move slider 5x faster")}, - {L("Ctrl+Mouse wheel"), L("Move slider 5x faster")}, - #endif + { L("Tab"), L("Switch between Prepare/Preview")}, + {shift + L("Any arrow"), L("Move slider 5x faster")}, + {shift + L("Mouse wheel"), L("Move slider 5x faster")}, + {ctrl + L("Any arrow"), L("Move slider 5x faster")}, + {ctrl + L("Mouse wheel"), L("Move slider 5x faster")}, { L("Home"), L("Horizontal slider - Move to start position")}, { L("End"), L("Horizontal slider - Move to last position")}, }; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index ff030e111b..df1dc541c4 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -168,11 +168,14 @@ wxDEFINE_EVENT(EVT_SYNC_CLOUD_PRESET, SimpleEvent); #ifdef __APPLE__ static const wxString ctrl = ("Ctrl+"); -static const std::string ctrl_t = "⌘"; +// FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? +static const std::string ctrl_t = u8"\u2318+"; // "⌘" (Mac Command) #else static const wxString ctrl = _L("Ctrl+"); +// FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? static const wxString ctrl_t = ctrl; #endif +static const wxString shift = _L("Shift+"); MainFrame::MainFrame() : DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_STYLE, "mainframe") @@ -2358,13 +2361,12 @@ void MainFrame::init_menubar_as_editor() [this](){return m_plater != nullptr && can_save(); }, this); #endif - #ifndef __APPLE__ - append_menu_item(fileMenu, wxID_ANY, _L("Save Project as") + dots + "\t" + ctrl + _L("Shift+") + "S", _L("Save current project as"), + append_menu_item(fileMenu, wxID_ANY, _L("Save Project as") + dots + "\t" + ctrl + shift + "S", _L("Save current project as"), [this](wxCommandEvent&) { if (m_plater) m_plater->save_project(true); }, "menu_save", nullptr, [this](){return m_plater != nullptr && can_save_as(); }, this); #else - append_menu_item(fileMenu, wxID_ANY, _L("Save Project as") + dots + "\t" + ctrl + _L("Shift+") + "S", _L("Save current project as"), + append_menu_item(fileMenu, wxID_ANY, _L("Save Project as") + dots + "\t" + ctrl + shift + "S", _L("Save current project as"), [this](wxCommandEvent&) { if (m_plater) m_plater->save_project(true); }, "", nullptr, [this](){return m_plater != nullptr && can_save_as(); }, this); #endif @@ -2388,7 +2390,7 @@ void MainFrame::init_menubar_as_editor() append_menu_item(import_menu, wxID_ANY, _L("Import Zip Archive") + dots, _L("Load models contained within a zip archive"), [this](wxCommandEvent&) { if (m_plater) m_plater->import_zip_archive(); }, "menu_import", nullptr, [this]() { return can_add_models(); }); - append_menu_item(import_menu, wxID_ANY, _L("Import Configs") + dots /*+ "\tCtrl+I"*/, _L("Load configs"), + append_menu_item(import_menu, wxID_ANY, _L("Import Configs") + dots /*+ "\t" + ctrl + "I"*/, _L("Load configs"), [this](wxCommandEvent&) { load_config_file(); }, "menu_import", nullptr, [this](){return true; }, this); @@ -2403,7 +2405,7 @@ void MainFrame::init_menubar_as_editor() append_menu_item(export_menu, wxID_ANY, _L("Export all objects as STLs") + dots, _L("Export all objects as STLs"), [this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(false, false, true); }, "menu_export_stl", nullptr, [this](){return can_export_model(); }, this); - append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\tCtrl+G"*/, _L("Export 3mf file without using some 3mf-extensions"), + append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\t" + ctrl + "G"*/, _L("Export 3mf file without using some 3mf-extensions"), [this](wxCommandEvent&) { if (m_plater) m_plater->export_core_3mf(); }, "menu_export_sliced_file", nullptr, [this](){return can_export_model(); }, this); // BBS export .gcode.3mf @@ -2411,15 +2413,15 @@ void MainFrame::init_menubar_as_editor() [this](wxCommandEvent&) { if (m_plater) wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_EXPORT_SLICED_FILE)); }, "menu_export_sliced_file", nullptr, [this](){return can_export_gcode(); }, this); - append_menu_item(export_menu, wxID_ANY, _L("Export all plate sliced file") + dots/* + "\tCtrl+G"*/, _L("Export all plate sliced file"), + append_menu_item(export_menu, wxID_ANY, _L("Export all plate sliced file") + dots/* + "\t" + ctrl + "G"*/, _L("Export all plate sliced file"), [this](wxCommandEvent&) { if (m_plater) wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_EXPORT_ALL_SLICED_FILE)); }, "menu_export_sliced_file", nullptr, [this]() {return can_export_all_gcode(); }, this); - append_menu_item(export_menu, wxID_ANY, _L("Export G-code") + dots/* + "\tCtrl+G"*/, _L("Export current plate as G-code"), + append_menu_item(export_menu, wxID_ANY, _L("Export G-code") + dots/* + "\t" + ctrl + "G"*/, _L("Export current plate as G-code"), [this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(false); }, "menu_export_gcode", nullptr, [this]() {return can_export_gcode(); }, this); append_menu_item( - export_menu, wxID_ANY, _L("Export Preset Bundle") + dots /* + "\tCtrl+E"*/, _L("Export current configuration to files"), + export_menu, wxID_ANY, _L("Export Preset Bundle") + dots /* + "\t" + ctrl + "E"*/, _L("Export current configuration to files"), [this](wxCommandEvent &) { export_config(); }, "menu_export_config", nullptr, []() { return true; }, this); @@ -2442,12 +2444,6 @@ void MainFrame::init_menubar_as_editor() if (m_plater != nullptr) { editMenu = new wxMenu(); - #ifdef __APPLE__ - // Backspace sign - wxString hotkey_delete = "\u232b"; - #else - wxString hotkey_delete = "Del"; - #endif auto handle_key_event = [](wxKeyEvent& evt) { if (wxGetApp().imgui()->update_key_data(evt)) { @@ -2488,7 +2484,7 @@ void MainFrame::init_menubar_as_editor() "menu_remove", nullptr, [this](){return can_delete_all(); }, this); editMenu->AppendSeparator(); // BBS Clone Selected - append_menu_item(editMenu, wxID_ANY, _L("Clone selected") /*+ "\tCtrl+M"*/, + append_menu_item(editMenu, wxID_ANY, _L("Clone selected") /*+ "\t" + ctrl + "M"*/, _L("Clone copies of selections"),[this](wxCommandEvent&) { m_plater->clone_selection(); }, @@ -2564,7 +2560,7 @@ void MainFrame::init_menubar_as_editor() "", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this); #if 0 // BBS Delete selected - append_menu_item(editMenu, wxID_ANY, _L("Delete selected") + "\tBackSpace", + append_menu_item(editMenu, wxID_ANY, _L("Delete selected") + "\t" + _L("Backspace"), _L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); }, @@ -2619,7 +2615,7 @@ void MainFrame::init_menubar_as_editor() m_plater->select_all(); }, "", nullptr, [this](){return can_select(); }, this); // BBS Deslect All - append_menu_item(editMenu, wxID_ANY, _L("Deselect all") + sep + "Esc", + append_menu_item(editMenu, wxID_ANY, _L("Deselect all") + sep + _L("Esc"), _L("Deselects all objects"), [this, handle_key_event](wxCommandEvent&) { wxKeyEvent e; e.SetEventType(wxEVT_KEY_DOWN); @@ -2738,7 +2734,7 @@ void MainFrame::init_menubar_as_editor() [this]() { return wxGetApp().show_outline(); }, this); /*viewMenu->AppendSeparator(); - append_menu_check_item(viewMenu, wxID_ANY, _L("Show &Wireframe") + "\tCtrl+Shift+Enter", _L("Show wireframes in 3D scene."), + append_menu_check_item(viewMenu, wxID_ANY, _L("Show &Wireframe") + "\t" + ctrl + shift + _L("Enter"), _L("Show wireframes in 3D scene."), [this](wxCommandEvent&) { m_plater->toggle_show_wireframe(); m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT)); }, this, [this]() { return m_plater->is_wireframe_enabled(); }, [this]() { return m_plater->is_show_wireframe(); }, this);*/ @@ -2761,7 +2757,7 @@ void MainFrame::init_menubar_as_editor() #ifdef __APPLE__ wxWindowID bambu_studio_id_base = wxWindow::NewControlId(int(2)); wxMenu* parent_menu = m_menubar->OSXGetAppleMenu(); - //auto preference_item = new wxMenuItem(parent_menu, OrcaSlicerMenuPreferences + bambu_studio_id_base, _L("Preferences") + "\tCtrl+,", ""); + //auto preference_item = new wxMenuItem(parent_menu, OrcaSlicerMenuPreferences + bambu_studio_id_base, _L("Preferences") + "\t" + ctrl + ",", ""); #else wxMenu* parent_menu = m_topbar->GetTopMenu(); auto preference_item = new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", ""); @@ -3204,11 +3200,11 @@ void MainFrame::init_menubar_as_gcodeviewer() #if 0 wxMenu* fileMenu = new wxMenu; { - append_menu_item(fileMenu, wxID_ANY, _L("&Open G-code") + dots + "\tCtrl+O", _L("Open a G-code file"), + append_menu_item(fileMenu, wxID_ANY, _L("&Open G-code") + dots + "\t" + ctrl + "O", _L("Open a G-code file"), [this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->load_gcode(); }, "open", nullptr, [this]() {return m_plater != nullptr; }, this); #ifdef __APPLE__ - append_menu_item(fileMenu, wxID_ANY, _L("Re&load from Disk") + dots + "\tCtrl+Shift+R", + append_menu_item(fileMenu, wxID_ANY, _L("Re&load from Disk") + dots + "\t" + ctrl + shift + "R", _L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_gcode_from_disk(); }, "", nullptr, [this]() { return !m_plater->get_last_loaded_gcode().empty(); }, this); #else diff --git a/src/slic3r/GUI/ModelMall.cpp b/src/slic3r/GUI/ModelMall.cpp index 5fbd79a813..974d749433 100644 --- a/src/slic3r/GUI/ModelMall.cpp +++ b/src/slic3r/GUI/ModelMall.cpp @@ -63,11 +63,13 @@ namespace GUI { m_control_refresh->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCursor(wxCURSOR_ARROW)); }); #ifdef __APPLE__ - m_control_back->SetToolTip(_L("Click to return (Command + Left Arrow)")); - m_control_forward->SetToolTip(_L("Click to continue (Command + Right Arrow)")); + // FIXME: maybe should be using GUI::shortkey_ctrl_prefix() or equivalent? + m_control_back->SetToolTip(_L("Click to return") + "(" + u8"\u2318+" /* u8"⌘+" */ + _L("Left Arrow") + ")"); + m_control_forward->SetToolTip(_L("Click to continue") + "(" + u8"\u2318+" /* u8"⌘+" */ + _L("Right Arrow") + ")"); #else - m_control_back->SetToolTip(_L("Click to return (Alt + Left Arrow)")); - m_control_forward->SetToolTip(_L("Click to continue (Alt + Right Arrow)")); + // FIXME: maybe should be using GUI::shortkey_alt_prefix() or equivalent? + m_control_back->SetToolTip(_L("Click to return") + "(" + _L("Alt+") + _L("Left Arrow") + ")"); + m_control_forward->SetToolTip(_L("Click to continue") + "(" + _L("Alt+") + _L("Right Arrow") + ")"); #endif m_control_refresh->SetToolTip(_L("Refresh")); diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index c5ac8ca687..92bf17b217 100644 --- a/src/slic3r/GUI/ParamsPanel.cpp +++ b/src/slic3r/GUI/ParamsPanel.cpp @@ -228,7 +228,7 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c // BBS: new layout //m_search_btn = new ScalableButton(m_top_panel, wxID_ANY, "search", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true); - //m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), "Ctrl+F")); + //m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), _L("Ctrl+") + "F"); //m_search_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &) { wxGetApp().plater()->search(false); }); m_compare_btn = new ScalableButton(m_top_panel, wxID_ANY, "compare", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 5a9a7ecf65..f9d5e350b8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3482,7 +3482,7 @@ void Plater::priv::collapse_sidebar(bool collapse) std::string new_tooltip = collapse ? _u8L("Expand sidebar") : _u8L("Collapse sidebar"); - new_tooltip += " [Shift+Tab]"; + new_tooltip += " [" + _u8L("Shift+") + _u8L("Tab") + "]"; int id = collapse_toolbar.get_item_id("collapse_sidebar"); collapse_toolbar.set_tooltip(id, new_tooltip); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index ac99ffcd39..31994e1f04 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -251,7 +251,7 @@ void Tab::create_preset_tab() "or click this button."))); add_scaled_button(panel, &m_search_btn, "search"); - m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), "Ctrl+F"));*/ + m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), _L("Ctrl+") + "F"));*/ // Bitmaps to be shown on the "Revert to system" aka "Lock to system" button next to each input field. add_scaled_bitmap(this, m_bmp_value_lock , "unlock_normal");