From 6b1a824541c622afed286fad2b2577370cf35d98 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Thu, 6 Mar 2025 10:10:34 +0800 Subject: [PATCH] ENH:modify "delete" in KBShortcutsDialog jira: none Change-Id: I9736273a210bc2f0ac49607a4539613cee0f19b5 --- src/slic3r/GUI/GUI_Factories.cpp | 9 ++++----- src/slic3r/GUI/KBShortcutsDialog.cpp | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 66717d897..6395895e5 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -476,14 +476,13 @@ void MenuFactory::append_menu_item_set_visible(wxMenu* menu) void MenuFactory::append_menu_item_delete(wxMenu* menu) { -#ifdef __WINDOWS__ - append_menu_item(menu, wxID_ANY, _L("Delete") + "\tDelete", _L("Delete the selected object"), - [](wxCommandEvent&) { plater()->remove_selected(); }, "menu_delete", nullptr, - []() { return plater()->can_delete(); }, m_parent); -#else +#ifdef __APPLE__ append_menu_item(menu, wxID_ANY, _L("Delete") + "\tBackSpace", _L("Delete the selected object"), [](wxCommandEvent&) { plater()->remove_selected(); }, "", nullptr, []() { return plater()->can_delete(); }, m_parent); +#else + append_menu_item(menu, wxID_ANY, _L("Delete") + "\tDelete", _L("Delete the selected object"), [](wxCommandEvent &) { plater()->remove_selected(); }, "menu_delete", nullptr, + []() { return plater()->can_delete(); }, m_parent); #endif } diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index bfce11b3c..d9652003f 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -207,9 +207,9 @@ void KBShortcutsDialog::fill_shortcuts() #endif //DEL #ifdef __APPLE__ - {"fn+⌫", L("Delete selected")}, + {"BackSpace", L("Delete selected")}, #else - {L("Del"), L("Delete selected")}, + {"Delete", L("Delete selected")}, #endif // Help #ifdef __WINDOWS__ @@ -274,7 +274,11 @@ void KBShortcutsDialog::fill_shortcuts() Shortcuts object_list_shortcuts = { {"1-9", L("Set extruder number for the objects and parts") }, - {L("Del"), L("Delete objects, parts, modifiers ")}, +#ifdef __APPLE__ + {"BackSpace", L("Delete objects, parts, modifiers ")}, +#else + {"Delete", L("Delete objects, parts, modifiers ")}, +#endif {"Esc", L("Deselect all")}, {ctrl + "C", L("Copy to clipboard")}, {ctrl + "V", L("Paste from clipboard")}, @@ -330,7 +334,13 @@ wxPanel* KBShortcutsDialog::create_page(wxWindow* parent, const ShortcutsItem& s for (int i = 0; i < items_count; ++i) { const auto &[shortcut, description] = shortcuts.second[i]; - auto key = new wxStaticText(scrollable_panel, wxID_ANY, _(shortcut)); + wxStaticText* key = nullptr; + if (shortcut == "Delete" || shortcut == "BackSpace") { + key = new wxStaticText(scrollable_panel, wxID_ANY, shortcut); + } + else { + key = new wxStaticText(scrollable_panel, wxID_ANY, _(shortcut)); + } key->SetForegroundColour(wxColour(50, 58, 61)); key->SetFont(bold_font); grid_sizer->Add(key, 0, wxALIGN_CENTRE_VERTICAL);