Belt: register the raw G-code toggle as a Preview shortcut

Main's assignable shortcuts replaced the canvas key switch that carried
the belt "show designed / show raw G-code" toggle on B. Register it as
ToggleBeltRawGcode, bound to B in the Preview (B is only taken on the
Plater, by the mesh boolean gizmo), so it can be rebound and is listed in
the shortcuts dialog. The legend checkbox shows whatever key is bound.
This commit is contained in:
harrierpigeon
2026-10-04 19:21:22 -05:00
parent bbb94724ba
commit e8a499df7b
4 changed files with 18 additions and 4 deletions
+11 -1
View File
@@ -3804,6 +3804,16 @@ bool GLCanvas3D::handle_shortcut(const KeyChord& chord)
m_dirty = true;
request_extra_frame();
break;
case Shortcut::ToggleBeltRawGcode:
// Same state as the legend checkbox and the canvas-toolbar menu item. The designed-view
// back-transform is baked into the toolpaths at load time, so the preview is re-converted.
if (m_gcode_viewer.is_belt_view()) {
m_gcode_viewer.toggle_belt_show_designed();
if (Plater* plater = wxGetApp().plater())
plater->refresh_belt_view();
m_dirty = true;
}
break;
case Shortcut::ToggleOneLayerMode:
get_gcode_viewer().get_layers_slider()->switch_one_layer_mode();
m_dirty = true;
@@ -10196,7 +10206,7 @@ void GLCanvas3D::_render_canvas_toolbar()
};
// Belt printers, G-code preview only: toggle the designed (upright) view vs the raw
// machine-frame G-code. Same state as hotkey B and the legend checkbox; the reload is
// machine-frame G-code. Same state as the shortcut and the legend checkbox; the reload is
// deferred (CallAfter) so the preview is not rebuilt mid-render.
if (m_canvas_type == ECanvasType::CanvasPreview && m_gcode_viewer.is_belt_view()) {
create_menu_item( _utf8(L("Show raw G-code (belt only)")),