tweak gcodeviewer

This commit is contained in:
SoftFever 2023-09-03 10:17:42 +08:00
parent 0feea859c5
commit c54386d958
3 changed files with 10 additions and 10 deletions

View file

@ -788,9 +788,9 @@ const GCodeViewer::Color GCodeViewer::Neutral_Color = { 0.25f, 0.25f, 0.25f, 1.0
GCodeViewer::GCodeViewer()
{
m_moves_slider = new IMSlider(0, 0, 0, 100, wxSL_HORIZONTAL);
m_moves_slider->set_scale(0.6f);
m_moves_slider->set_scale(GCODE_VIEWER_SLIDER_SCALE);
m_layers_slider = new IMSlider(0, 0, 0, 100, wxSL_VERTICAL);
m_layers_slider->set_scale(0.6f);
m_layers_slider->set_scale(GCODE_VIEWER_SLIDER_SCALE);
m_extrusions.reset_role_visibility_flags();
// m_sequential_view.skip_invisible_moves = true;
@ -1296,7 +1296,7 @@ void GCodeViewer::render(int canvas_width, int canvas_height, int right_margin)
}
//BBS fixed bottom_margin for space to render horiz slider
int bottom_margin = 39;
int bottom_margin = SLIDER_BOTTOM_MARGIN;
m_sequential_view.m_show_gcode_window =
m_sequential_view.m_show_gcode_window ||
(m_sequential_view.current.last != m_sequential_view.endpoints.last && !m_no_render_path);

View file

@ -26,6 +26,11 @@ namespace GUI {
class PartPlateList;
class OpenGLManager;
static const float GCODE_VIEWER_SLIDER_SCALE = 0.6f;
static const float SLIDER_DEFAULT_RIGHT_MARGIN = 10.0f;
static const float SLIDER_DEFAULT_BOTTOM_MARGIN = 10.0f;
static const float SLIDER_RIGHT_MARGIN = 124.0f * GCODE_VIEWER_SLIDER_SCALE;
static const float SLIDER_BOTTOM_MARGIN = 64.0f * GCODE_VIEWER_SLIDER_SCALE;
class GCodeViewer
{
using IBufferType = unsigned short;

View file

@ -76,11 +76,6 @@
static constexpr const float TRACKBALLSIZE = 0.8f;
static const float SLIDER_DEFAULT_RIGHT_MARGIN = 10.0f;
static const float SLIDER_DEFAULT_BOTTOM_MARGIN = 10.0f;
static const float SLIDER_RIGHT_MARGIN = 124.0f;
static const float SLIDER_BOTTOM_MARGIN = 64.0f;
float GLCanvas3D::DEFAULT_BG_LIGHT_COLOR[3] = { 0.906f, 0.906f, 0.906f };
float GLCanvas3D::DEFAULT_BG_LIGHT_COLOR_DARK[3] = { 0.329f, 0.329f, 0.353f };
float GLCanvas3D::ERROR_BG_LIGHT_COLOR[3] = { 0.753f, 0.192f, 0.039f };
@ -6952,8 +6947,8 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale()
IMSlider* m_layers_slider = get_gcode_viewer().get_layers_slider();
IMSlider* m_moves_slider = get_gcode_viewer().get_moves_slider();
const float sc = m_retina_helper->get_scale_factor();
m_layers_slider->set_scale(sc);
m_moves_slider->set_scale(sc);
m_layers_slider->set_scale(sc * m_layers_slider->m_scale);
m_moves_slider->set_scale(sc * m_layers_slider->m_scale);
m_gcode_viewer.set_scale(sc);
auto* m_notification = wxGetApp().plater()->get_notification_manager();