Some changes to gcode window toggles (#2704)

* Show gcode window automatically (#2572)

* Move the show gcode toggle to view menu, and remember if gcode window is shown last time

* fix an issue when merging main branch

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Noisyfox 2023-11-29 21:19:56 +08:00 committed by GitHub
parent b86b8ea810
commit 284c3e71eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 29 deletions

View file

@ -650,7 +650,6 @@ public:
std::string comment;
};
bool m_is_dark = false;
bool m_visible{ true };
uint64_t m_selected_line_id{ 0 };
size_t m_last_lines_size{ 0 };
std::string m_filename;
@ -674,8 +673,6 @@ public:
m_filename.shrink_to_fit();
}
void toggle_visibility() { m_visible = !m_visible; }
//BBS: GUI refactor: add canvas size
//void render(float top, float bottom, uint64_t curr_line_id) const;
void render(float top, float bottom, float right, uint64_t curr_line_id) const;
@ -701,7 +698,7 @@ public:
GCodeWindow gcode_window;
std::vector<unsigned int> gcode_ids;
float m_scale = 1.0;
bool m_show_gcode_window = false;
bool m_show_marker = false;
void render(const bool has_render_path, float legend_height, int canvas_width, int canvas_height, int right_margin, const EViewType& view_type);
};
@ -883,8 +880,6 @@ public:
void export_toolpaths_to_obj(const char* filename) const;
void toggle_gcode_window_visibility() { m_sequential_view.gcode_window.toggle_visibility(); }
std::vector<CustomGCode::Item>& get_custom_gcode_per_print_z() { return m_custom_gcode_per_print_z; }
size_t get_extruders_count() { return m_extruders_count; }
void push_combo_style();