Fix display of command key

This commit is contained in:
Noisyfox 2025-03-30 01:11:04 +08:00
parent eb0d0386a0
commit 2fbeb75ced

View file

@ -168,8 +168,10 @@ wxDEFINE_EVENT(EVT_SYNC_CLOUD_PRESET, SimpleEvent);
#ifdef __APPLE__
static const wxString ctrl = ("Ctrl+");
static const std::string ctrl_t = "";
#else
static const wxString ctrl = _L("Ctrl+");
static const wxString ctrl_t = ctrl;
#endif
MainFrame::MainFrame() :
@ -2502,7 +2504,7 @@ void MainFrame::init_menubar_as_editor()
editMenu->AppendSeparator();
#else
// BBS undo
append_menu_item(editMenu, wxID_ANY, _L("Undo") + sep + ctrl + "Z",
append_menu_item(editMenu, wxID_ANY, _L("Undo") + sep + ctrl_t + "Z",
_L("Undo"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);
@ -2514,7 +2516,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->undo(); },
"", nullptr, [this](){return m_plater->can_undo(); }, this);
// BBS redo
append_menu_item(editMenu, wxID_ANY, _L("Redo") + sep + ctrl + "Y",
append_menu_item(editMenu, wxID_ANY, _L("Redo") + sep + ctrl_t + "Y",
_L("Redo"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);
@ -2527,7 +2529,7 @@ void MainFrame::init_menubar_as_editor()
"", nullptr, [this](){return m_plater->can_redo(); }, this);
editMenu->AppendSeparator();
// BBS Cut TODO
append_menu_item(editMenu, wxID_ANY, _L("Cut") + sep + ctrl + "X",
append_menu_item(editMenu, wxID_ANY, _L("Cut") + sep + ctrl_t + "X",
_L("Cut selection to clipboard"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);
@ -2539,7 +2541,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->cut_selection_to_clipboard(); },
"", nullptr, [this]() {return m_plater->can_copy_to_clipboard(); }, this);
// BBS Copy
append_menu_item(editMenu, wxID_ANY, _L("Copy") + sep + ctrl + "C",
append_menu_item(editMenu, wxID_ANY, _L("Copy") + sep + ctrl_t + "C",
_L("Copy selection to clipboard"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);
@ -2551,7 +2553,7 @@ void MainFrame::init_menubar_as_editor()
m_plater->copy_selection_to_clipboard(); },
"", nullptr, [this](){return m_plater->can_copy_to_clipboard(); }, this);
// BBS Paste
append_menu_item(editMenu, wxID_ANY, _L("Paste") + sep + ctrl + "V",
append_menu_item(editMenu, wxID_ANY, _L("Paste") + sep + ctrl_t + "V",
_L("Paste clipboard"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);
@ -2607,7 +2609,7 @@ void MainFrame::init_menubar_as_editor()
#endif
// BBS Select All
append_menu_item(editMenu, wxID_ANY, _L("Select all") + sep + ctrl + "A",
append_menu_item(editMenu, wxID_ANY, _L("Select all") + sep + ctrl_t + "A",
_L("Selects all objects"), [this, handle_key_event](wxCommandEvent&) {
wxKeyEvent e;
e.SetEventType(wxEVT_KEY_DOWN);