mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-11 09:51:06 +00:00
Merge branch 'main' into belt-printer
This commit is contained in:
@@ -99,6 +99,8 @@
|
||||
#include "slic3r/GUI/Gizmos/GizmoObjectManipulation.hpp"
|
||||
#include "slic3r/GUI/PartPlate.hpp"
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
namespace Slic3r { class PrintBase; }
|
||||
|
||||
|
||||
@@ -3026,7 +3028,7 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
auto calculate_offsets = [max_width, window_padding](const std::vector<std::pair<std::string, std::vector<::string>>>& title_columns, float extra_size = 0.0f) {
|
||||
auto calculate_offsets = [max_width, window_padding](const std::vector<std::pair<std::string, std::vector<std::string>>>& title_columns, float extra_size = 0.0f) {
|
||||
const ImGuiStyle& style = ImGui::GetStyle();
|
||||
std::vector<float> offsets;
|
||||
offsets.push_back(max_width(title_columns[0].second, title_columns[0].first, extra_size) + 3.0f * style.ItemSpacing.x + style.WindowPadding.x);
|
||||
@@ -3173,7 +3175,7 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
|
||||
}
|
||||
::sprintf(buff, "%.2f", longest_str);
|
||||
|
||||
std::vector<std::pair<std::string, std::vector<::string>>> title_columns;
|
||||
std::vector<std::pair<std::string, std::vector<std::string>>> title_columns;
|
||||
if (displayed_columns & ColumnData::Model) {
|
||||
title_columns.push_back({ _u8L("Filament"), {""} });
|
||||
title_columns.push_back({ _u8L("Model"), {buff} });
|
||||
@@ -3405,8 +3407,8 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
|
||||
for (int j = idx; j < extruder_filaments.size() && j < idx + line_capacity; ++j) {
|
||||
auto text_info = imgui.calculate_filament_group_text_size(get_filament_display_type(extruder_filaments[j]));
|
||||
auto text_size = std::get<0>(text_info);
|
||||
filament_group_item_align_width = max(filament_group_item_align_width, text_size.x);
|
||||
text_line_height = max(text_line_height, text_size.y);
|
||||
filament_group_item_align_width = std::max(filament_group_item_align_width, text_size.x);
|
||||
text_line_height = std::max(text_line_height, text_size.y);
|
||||
}
|
||||
container_height += (three_words_width * 1.3f + text_line_height );
|
||||
}
|
||||
@@ -3799,7 +3801,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
return ret;
|
||||
};
|
||||
|
||||
auto calculate_offsets = [max_width, this](const std::vector<std::pair<std::string, std::vector<::string>>>& title_columns, float extra_size = 0.0f) {
|
||||
auto calculate_offsets = [max_width, this](const std::vector<std::pair<std::string, std::vector<std::string>>>& title_columns, float extra_size = 0.0f) {
|
||||
const ImGuiStyle& style = ImGui::GetStyle();
|
||||
std::vector<float> offsets;
|
||||
// ORCA increase spacing for more readable format. Using direct number requires much less code change in here. GetTextLineHeight for additional spacing for icon_size
|
||||
@@ -3832,7 +3834,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
if (extruder_id + 1 != static_cast<unsigned char>(item.extruder))
|
||||
continue;
|
||||
|
||||
if (item.type != ColorChange)
|
||||
if (item.type != CustomGCode::ColorChange)
|
||||
continue;
|
||||
|
||||
if (!zs_built) {
|
||||
@@ -4224,7 +4226,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
total_filaments.push_back(buffer);
|
||||
|
||||
|
||||
std::vector<std::pair<std::string, std::vector<::string>>> title_columns;
|
||||
std::vector<std::pair<std::string, std::vector<std::string>>> title_columns;
|
||||
if (displayed_columns & ColumnData::Model) {
|
||||
title_columns.push_back({ _u8L("Filament"), {""} });
|
||||
title_columns.push_back({ _u8L("Model"), total_filaments });
|
||||
@@ -4999,10 +5001,10 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
|
||||
ImGui::SameLine();
|
||||
|
||||
switch (custom_gcode.type) {
|
||||
case PausePrint: imgui.text(cgcode_pause_str); break;
|
||||
case Template: imgui.text(cgcode_template_str); break;
|
||||
case ToolChange: imgui.text(cgcode_toolchange_str); break;
|
||||
case Custom: imgui.text(cgcode_custom_str); break;
|
||||
case CustomGCode::PausePrint: imgui.text(cgcode_pause_str); break;
|
||||
case CustomGCode::Template: imgui.text(cgcode_template_str); break;
|
||||
case CustomGCode::ToolChange: imgui.text(cgcode_toolchange_str); break;
|
||||
case CustomGCode::Custom: imgui.text(cgcode_custom_str); break;
|
||||
default: imgui.text(cgcode_unknown_str); break;
|
||||
}
|
||||
ImGui::SameLine(max_len);
|
||||
|
||||
Reference in New Issue
Block a user