FIX: .gcode file shall disable preview menu (STUDIO-2320)
https://jira.bambooolab.com/browse/STUDIO-2320 Change-Id: I54cd49a49a8b08916872eae75534ef4c1d915cb5
This commit is contained in:
parent
ede8a2dc30
commit
1beee1eebf
|
@ -1086,6 +1086,14 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fold = false;
|
m_fold = false;
|
||||||
|
|
||||||
|
bool only_gcode_3mf = false;
|
||||||
|
PartPlate* current_plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||||
|
bool current_has_print_instances = current_plate->has_printable_instances();
|
||||||
|
if (current_plate->is_slice_result_valid() && wxGetApp().model().objects.empty() && !current_has_print_instances)
|
||||||
|
only_gcode_3mf = true;
|
||||||
|
|
||||||
|
m_layers_slider->set_menu_enable(!(only_gcode || only_gcode_3mf));
|
||||||
m_layers_slider->set_as_dirty();
|
m_layers_slider->set_as_dirty();
|
||||||
m_moves_slider->set_as_dirty();
|
m_moves_slider->set_as_dirty();
|
||||||
|
|
||||||
|
|
|
@ -1125,6 +1125,9 @@ void IMSlider::render_go_to_layer_dialog()
|
||||||
|
|
||||||
void IMSlider::render_menu()
|
void IMSlider::render_menu()
|
||||||
{
|
{
|
||||||
|
if (!m_menu_enable)
|
||||||
|
return;
|
||||||
|
|
||||||
ImGuiWrapper::push_menu_style(m_scale);
|
ImGuiWrapper::push_menu_style(m_scale);
|
||||||
int extruder_num = m_extruder_colors.size();
|
int extruder_num = m_extruder_colors.size();
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,7 @@ public:
|
||||||
float m_scale = 1.0;
|
float m_scale = 1.0;
|
||||||
void set_scale(float scale = 1.0);
|
void set_scale(float scale = 1.0);
|
||||||
void on_change_color_mode(bool is_dark);
|
void on_change_color_mode(bool is_dark);
|
||||||
|
void set_menu_enable(bool enable = true) { m_menu_enable = enable; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void add_custom_gcode(std::string custom_gcode);
|
void add_custom_gcode(std::string custom_gcode);
|
||||||
|
@ -179,7 +180,8 @@ private:
|
||||||
bool m_is_right_down = false;
|
bool m_is_right_down = false;
|
||||||
bool m_is_one_layer = false;
|
bool m_is_one_layer = false;
|
||||||
bool m_is_focused = false;
|
bool m_is_focused = false;
|
||||||
bool m_show_menu = false;
|
bool m_show_menu = false;
|
||||||
|
bool m_menu_enable = true;
|
||||||
bool m_show_custom_gcode_window = false;
|
bool m_show_custom_gcode_window = false;
|
||||||
bool m_show_go_to_layer_dialog = false;
|
bool m_show_go_to_layer_dialog = false;
|
||||||
bool m_force_mode_apply = true;
|
bool m_force_mode_apply = true;
|
||||||
|
|
Loading…
Reference in New Issue