A few small refactorings

This commit is contained in:
enricoturri1966 2022-03-10 11:27:05 +01:00
parent 578b80e12c
commit a9465ddedc
4 changed files with 19 additions and 20 deletions
src/slic3r/GUI

View file

@ -4629,14 +4629,14 @@ void GCodeViewer::render_statistics()
ImGuiWrapper& imgui = *wxGetApp().imgui();
auto add_time = [this, &imgui](const std::string& label, int64_t time) {
auto add_time = [&imgui](const std::string& label, int64_t time) {
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, label);
ImGui::SameLine(offset);
imgui.text(std::to_string(time) + " ms (" + get_time_dhms(static_cast<float>(time) * 0.001f) + ")");
};
auto add_memory = [this, &imgui](const std::string& label, int64_t memory) {
auto format_string = [memory](const std::string& units, float value) {
auto add_memory = [&imgui](const std::string& label, int64_t memory) {
auto format_string = [memory](const std::string& units, float value) {
return std::to_string(memory) + " bytes (" +
Slic3r::float_to_string_decimal_point(float(memory) * value, 3)
+ " " + units + ")";
@ -4658,7 +4658,7 @@ void GCodeViewer::render_statistics()
imgui.text(format_string("GB", inv_gb));
};
auto add_counter = [this, &imgui](const std::string& label, int64_t counter) {
auto add_counter = [&imgui](const std::string& label, int64_t counter) {
imgui.text_colored(ImGuiWrapper::COL_ORANGE_LIGHT, label);
ImGui::SameLine(offset);
imgui.text(std::to_string(counter));