From 4d7b5d4451f46c75ca253259a6e991e872e847df Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 3 Nov 2020 15:44:59 +0100 Subject: [PATCH] "Sequential slider applied only to top layer" parameter from the Preferences is applied just for the horizontal slider now --- src/slic3r/GUI/DoubleSlider.cpp | 12 +++++++----- src/slic3r/GUI/DoubleSlider.hpp | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index 44e0bcd42..26d4f95cb 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -53,11 +53,6 @@ static std::string gcode(Type type) } } -static bool is_lower_thumb_editable() -{ - return Slic3r::GUI::get_app_config()->get("seq_top_layer_only") == "0"; -} - Control::Control( wxWindow *parent, wxWindowID id, int lowerValue, @@ -960,6 +955,13 @@ int Control::get_value_from_position(const wxCoord x, const wxCoord y) return int(m_min_value + double(height - SLIDER_MARGIN - y) / step + 0.5); } +bool Control::is_lower_thumb_editable() +{ + if (m_draw_mode == dmSequentialGCodeView) + return Slic3r::GUI::get_app_config()->get("seq_top_layer_only") == "0"; + return true; +} + bool Control::detect_selected_slider(const wxPoint& pt) { if (is_point_in_rect(pt, m_rect_lower_thumb)) diff --git a/src/slic3r/GUI/DoubleSlider.hpp b/src/slic3r/GUI/DoubleSlider.hpp index d13e6259f..511858dd5 100644 --- a/src/slic3r/GUI/DoubleSlider.hpp +++ b/src/slic3r/GUI/DoubleSlider.hpp @@ -293,6 +293,7 @@ protected: void draw_thumb_text(wxDC& dc, const wxPoint& pos, const SelectedSlider& selection) const; void update_thumb_rect(const wxCoord begin_x, const wxCoord begin_y, const SelectedSlider& selection); + bool is_lower_thumb_editable(); bool detect_selected_slider(const wxPoint& pt); void correct_lower_value(); void correct_higher_value();