mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
post changes after merging BS1.7.4
Remove tracking etc..
This commit is contained in:
parent
e65b11a831
commit
2a478ab4f9
615 changed files with 46215 additions and 54844 deletions
|
@ -132,7 +132,7 @@ void GLGizmoMeshBoolean::on_render()
|
|||
}
|
||||
|
||||
float src_color[3] = { 1.0f, 1.0f, 1.0f };
|
||||
float tool_color[3] = { 0.0f, 174.0f / 255.0f, 66.0f / 255.0f };
|
||||
float tool_color[3] = { 0.0f, 150.0f / 255.0f, 136.0f / 255.0f };
|
||||
m_parent.get_selection().render_bounding_box(src_bb, src_color, m_parent.get_scale());
|
||||
m_parent.get_selection().render_bounding_box(tool_bb, tool_color, m_parent.get_scale());
|
||||
}
|
||||
|
@ -179,12 +179,17 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
|
|||
GizmoImguiSetNextWIndowPos(x, y, ImGuiCond_Always, 0.0f, 0.0f);
|
||||
GizmoImguiBegin("MeshBoolean", ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar);
|
||||
|
||||
const int max_tab_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(_L("Union").c_str()).x,
|
||||
std::max(ImGui::CalcTextSize(_L("Difference").c_str()).x, ImGui::CalcTextSize(_L("Intersection").c_str()).x));
|
||||
const int max_cap_length = ImGui::GetStyle().WindowPadding.x + ImGui::GetStyle().ItemSpacing.x + std::max(ImGui::CalcTextSize(_L("Source Volume").c_str()).x, ImGui::CalcTextSize(_L("Tool Volume").c_str()).x);
|
||||
const int select_btn_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(("1 " + _L("selected")).c_str()).x, ImGui::CalcTextSize(_L("Select").c_str()).x);
|
||||
const int max_tab_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(_u8L("Union").c_str()).x,
|
||||
std::max(ImGui::CalcTextSize(_u8L("Difference").c_str()).x, ImGui::CalcTextSize(_u8L("Intersection").c_str()).x));
|
||||
const int max_cap_length = ImGui::GetStyle().WindowPadding.x + ImGui::GetStyle().ItemSpacing.x +
|
||||
std::max({ImGui::CalcTextSize(_u8L("Source Volume").c_str()).x,
|
||||
ImGui::CalcTextSize(_u8L("Tool Volume").c_str()).x,
|
||||
ImGui::CalcTextSize(_u8L("Subtract from").c_str()).x,
|
||||
ImGui::CalcTextSize(_u8L("Subtract with").c_str()).x});
|
||||
|
||||
auto selectable = [this](const wxString& label, bool selected, const ImVec2& size_arg) {
|
||||
const int select_btn_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(("1 " + _u8L("selected")).c_str()).x, ImGui::CalcTextSize(_u8L("Select").c_str()).x);
|
||||
|
||||
auto selectable = [this](const std::string& label, bool selected, const ImVec2& size_arg) {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 0,0 });
|
||||
|
||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||
|
@ -195,13 +200,13 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
|
|||
|
||||
if (selected || hovered) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
|
||||
}
|
||||
else {
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
|
||||
}
|
||||
|
||||
bool res = ImGui::Button(label.c_str(), size_arg);
|
||||
|
@ -240,15 +245,15 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
|
|||
};
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0);
|
||||
if (selectable(_L("Union").c_str(), m_operation_mode == MeshBooleanOperation::Union, ImVec2(max_tab_length, 0.0f))) {
|
||||
if (selectable(_u8L("Union"), m_operation_mode == MeshBooleanOperation::Union, ImVec2(max_tab_length, 0.0f))) {
|
||||
m_operation_mode = MeshBooleanOperation::Union;
|
||||
}
|
||||
ImGui::SameLine(0, 0);
|
||||
if (selectable(_L("Difference").c_str(), m_operation_mode == MeshBooleanOperation::Difference, ImVec2(max_tab_length, 0.0f))) {
|
||||
if (selectable(_u8L("Difference"), m_operation_mode == MeshBooleanOperation::Difference, ImVec2(max_tab_length, 0.0f))) {
|
||||
m_operation_mode = MeshBooleanOperation::Difference;
|
||||
}
|
||||
ImGui::SameLine(0, 0);
|
||||
if (selectable(_L("Intersection").c_str(), m_operation_mode == MeshBooleanOperation::Intersection, ImVec2(max_tab_length, 0.0f))) {
|
||||
if (selectable(_u8L("Intersection"), m_operation_mode == MeshBooleanOperation::Intersection, ImVec2(max_tab_length, 0.0f))) {
|
||||
m_operation_mode = MeshBooleanOperation::Intersection;
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
@ -257,10 +262,10 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
|
|||
std::string cap_str1 = m_operation_mode != MeshBooleanOperation::Difference ? _u8L("Part 1") : _u8L("Subtract from");
|
||||
m_imgui->text(cap_str1);
|
||||
ImGui::SameLine(max_cap_length);
|
||||
wxString select_src_str = m_src.mv ? "1 " + _L("selected") : _L("Select");
|
||||
select_src_str << "##select_source_volume";
|
||||
std::string select_src_str = m_src.mv ? "1 " + _u8L("selected") : _u8L("Select");
|
||||
select_src_str += "##select_source_volume";
|
||||
ImGui::PushItemWidth(select_btn_length);
|
||||
if (selectable(select_src_str.c_str(), m_selecting_state == MeshBooleanSelectingState::SelectSource, ImVec2(select_btn_length, 0)))
|
||||
if (selectable(select_src_str, m_selecting_state == MeshBooleanSelectingState::SelectSource, ImVec2(select_btn_length, 0)))
|
||||
m_selecting_state = MeshBooleanSelectingState::SelectSource;
|
||||
ImGui::PopItemWidth();
|
||||
if (m_src.mv) {
|
||||
|
@ -285,10 +290,10 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
|
|||
std::string cap_str2 = m_operation_mode != MeshBooleanOperation::Difference ? _u8L("Part 2") : _u8L("Subtract with");
|
||||
m_imgui->text(cap_str2);
|
||||
ImGui::SameLine(max_cap_length);
|
||||
wxString select_tool_str = m_tool.mv ? "1 " + _L("selected") : _L("Select");
|
||||
select_tool_str << "##select_tool_volume";
|
||||
std::string select_tool_str = m_tool.mv ? "1 " + _u8L("selected") : _u8L("Select");
|
||||
select_tool_str += "##select_tool_volume";
|
||||
ImGui::PushItemWidth(select_btn_length);
|
||||
if (selectable(select_tool_str.c_str(), m_selecting_state == MeshBooleanSelectingState::SelectTool, ImVec2(select_btn_length, 0)))
|
||||
if (selectable(select_tool_str, m_selecting_state == MeshBooleanSelectingState::SelectTool, ImVec2(select_btn_length, 0)))
|
||||
m_selecting_state = MeshBooleanSelectingState::SelectTool;
|
||||
ImGui::PopItemWidth();
|
||||
if (m_tool.mv) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue