Improve gcode preview navigation (#5326)

* preview: home/end to move to start/end step of the layer

Add HOME and END key action to preview tab which moves horizontal slider
position to a first and last position respectively

* preview: cross-layer gcode inspection

Automatically advance gcode preview to the next layer when pressing
right at the last step of the layer. Same for the first step of the
layer: pressing 'left' will switch preview to the previous layer
This commit is contained in:
Dima Buzdyk 2024-05-19 19:27:25 +05:00 committed by GitHub
parent 7a335590e2
commit 6369772510
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 36 deletions

View file

@ -1732,12 +1732,14 @@ void GCodeViewer::update_moves_slider(bool set_to_max)
++count;
}
bool keep_min = m_moves_slider->GetActiveValue() == m_moves_slider->GetMinValue();
m_moves_slider->SetSliderValues(values);
m_moves_slider->SetSliderAlternateValues(alternate_values);
m_moves_slider->SetMaxValue(view.endpoints.last - view.endpoints.first);
m_moves_slider->SetSelectionSpan(view.current.first - view.endpoints.first, view.current.last - view.endpoints.first);
if (set_to_max)
m_moves_slider->SetHigherValue(m_moves_slider->GetMaxValue());
m_moves_slider->SetHigherValue(keep_min ? m_moves_slider->GetMinValue() : m_moves_slider->GetMaxValue());
}
void GCodeViewer::update_layers_slider_mode()