Skip to content

Commit fcd5018

Browse files
coreywardlanewei120
authored andcommitted
Make new redo shortcut cross-platform; handle events from 3D canvas
1 parent 57aac24 commit fcd5018

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/slic3r/GUI/GLCanvas3D.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,6 +3634,14 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
36343634
post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE_ALL));
36353635
return;
36363636
}
3637+
case 'z':
3638+
case 'Z':
3639+
case WXK_CONTROL_Z: {
3640+
if (m_canvas_type == CanvasView3D || m_canvas_type == CanvasAssembleView) {
3641+
post_event(SimpleEvent(EVT_GLCANVAS_REDO));
3642+
}
3643+
return;
3644+
}
36373645
}
36383646
}
36393647
// CTRL is pressed

src/slic3r/GUI/GUI_ObjectList.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ ObjectList::ObjectList(wxWindow* parent) :
212212
{
213213
// Accelerators
214214
// wxAcceleratorEntry entries[25];
215-
wxAcceleratorEntry entries[26];
215+
wxAcceleratorEntry entries[27];
216216
int index = 0;
217217
entries[index++].Set(wxACCEL_CTRL, (int)'C', wxID_COPY);
218218
entries[index++].Set(wxACCEL_CTRL, (int)'X', wxID_CUT);
@@ -221,9 +221,7 @@ ObjectList::ObjectList(wxWindow* parent) :
221221
entries[index++].Set(wxACCEL_CTRL, (int)'A', wxID_SELECTALL);
222222
entries[index++].Set(wxACCEL_CTRL, (int)'Z', wxID_UNDO);
223223
entries[index++].Set(wxACCEL_CTRL, (int)'Y', wxID_REDO);
224-
#ifdef __APPLE__
225224
entries[index++].Set(wxACCEL_CTRL | wxACCEL_SHIFT, (int)'Z', wxID_REDO);
226-
#endif
227225
entries[index++].Set(wxACCEL_NORMAL, WXK_BACK, wxID_DELETE);
228226
//entries[index++].Set(wxACCEL_NORMAL, int('+'), wxID_ADD);
229227
//entries[index++].Set(wxACCEL_NORMAL, WXK_NUMPAD_ADD, wxID_ADD);
@@ -238,7 +236,7 @@ ObjectList::ObjectList(wxWindow* parent) :
238236
numbers_cnt++;
239237
// index++;
240238
}
241-
wxAcceleratorTable accel(26, entries);
239+
wxAcceleratorTable accel(27, entries);
242240
SetAcceleratorTable(accel);
243241

244242
this->Bind(wxEVT_MENU, [this](wxCommandEvent &evt) { this->copy(); }, wxID_COPY);

src/slic3r/GUI/KBShortcutsDialog.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,8 @@ void KBShortcutsDialog::fill_shortcuts()
254254
{ctrl + "A", L("Select all objects")},
255255
{ctrl + L("Shift+D"), L("Delete all")},
256256
{ctrl + "Z", L("Undo")},
257-
#ifdef __APPLE__
258257
{ctrl + "Shift+Z", L("Redo")},
259-
#else
260258
{ctrl + "Y", L("Redo")},
261-
#endif
262259
{ "M", L("Gizmo move") },
263260
{ "S", L("Gizmo scale") },
264261
{ "R", L("Gizmo rotate") },
@@ -291,11 +288,8 @@ void KBShortcutsDialog::fill_shortcuts()
291288
{ctrl + "A", L("Select all objects")},
292289
{ctrl + "K", L("Clone selected")},
293290
{ctrl + "Z", L("Undo")},
294-
#ifdef __APPLE__
295291
{ctrl + "Shift+Z", L("Redo")},
296-
#else
297292
{ctrl + "Y", L("Redo")},
298-
#endif
299293
{L("Space"), L("Select the object/part and press space to change the name")},
300294
{L("Mouse click"), L("Select the object/part and mouse click to change the name")},
301295
};

0 commit comments

Comments
 (0)