Merge branch 'main' into libvgcode

This commit is contained in:
Andrew Sun
2025-11-25 15:19:57 -05:00
committed by GitHub
451 changed files with 1642 additions and 7202 deletions

View File

@@ -348,11 +348,6 @@ enum class ActionButtonType : int {
abSendGCode
};
int SidebarProps::TitlebarMargin() { return 8; } // Use as side margins on titlebar. Has less margin on sides to create separation with its content
int SidebarProps::ContentMargin() { return 12; } // Use as side margins contents of title
int SidebarProps::IconSpacing() { return 10; } // Use on main elements
int SidebarProps::ElementSpacing() { return 5; } // Use if elements has relation between them like edit button for combo box etc.
struct ExtruderGroup : StaticGroup
{
ExtruderGroup(wxWindow * parent, int index, wxString const &title);
@@ -547,9 +542,9 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
hsizer_printer->Add(panel_nozzle_dia , 0, wxLEFT, FromDIP(4));
hsizer_printer->Add(panel_printer_bed, 0, wxLEFT, FromDIP(4));
//hsizer_printer->Add(btn_sync_printer , 0, wxLEFT, FromDIP(4));
vsizer_printer->AddSpacer(FromDIP(8));
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
vsizer_printer->AddSpacer(FromDIP(8));
vsizer_printer->AddSpacer(FromDIP(SidebarProps::ContentMarginV()));
// Printer - extruder
// double
@@ -2099,16 +2094,14 @@ Sidebar::Sidebar(Plater *parent)
//bSizer_filament_content->Add(p->sizer_filaments, 1, wxALIGN_CENTER | wxALL);
wxSizer *sizer_filaments2 = new wxBoxSizer(wxVERTICAL);
sizer_filaments2->AddSpacer(FromDIP(16));
sizer_filaments2->Add(p->sizer_filaments, 0, wxEXPAND, 0);
sizer_filaments2->AddSpacer(FromDIP(16));
p->m_panel_filament_content->SetSizer(sizer_filaments2);
p->m_panel_filament_content->Layout();
auto min_size = sizer_filaments2->GetMinSize();
if (min_size.y > p->m_panel_filament_content->GetMaxHeight())
min_size.y = p->m_panel_filament_content->GetMaxHeight();
p->m_panel_filament_content->SetMinSize(min_size);
scrolled_sizer->Add(p->m_panel_filament_content, 0, wxEXPAND, 0);
scrolled_sizer->Add(p->m_panel_filament_content, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(SidebarProps::ContentMarginV())); // ORCA use vertical margin on parent otherwise it shows scrollbar even on 1 filament
}
{
@@ -2769,6 +2762,8 @@ void Sidebar::msw_rescale()
p->m_bpButton_ams_filament->msw_rescale();
p->m_bpButton_set_filament->msw_rescale();
p->m_flushing_volume_btn->Rescale();
set_flushing_volume_warning(is_flush_config_modified()); // ORCA reapply appearance
//BBS
p->left_extruder->Rescale();
p->right_extruder->Rescale();
@@ -2849,6 +2844,7 @@ void Sidebar::sys_color_changed()
p->m_bpButton_ams_filament->msw_rescale();
p->m_bpButton_set_filament->msw_rescale();
p->m_flushing_volume_btn->Rescale();
set_flushing_volume_warning(is_flush_config_modified()); // ORCA reapply appearance
// BBS
#if 0
@@ -3565,21 +3561,12 @@ wxButton* Sidebar::get_wiping_dialog_button()
void Sidebar::set_flushing_volume_warning(const bool flushing_volume_modify)
{
if (flushing_volume_modify){
p->m_flushing_volume_btn->SetBorderColor(wxColour(255, 111, 0));
p->m_flushing_volume_btn->SetTextColor(wxColour(255, 111, 0));
}
else {
StateColor flush_fg_col(std::pair<wxColour, int>(wxColour(107, 107, 106), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(107, 107, 106), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(107, 107, 106), StateColor::Normal));
StateColor flush_bd_col(std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(172, 172, 172), StateColor::Normal));
p->m_flushing_volume_btn->SetBorderColor(flush_bd_col);
p->m_flushing_volume_btn->SetTextColor(flush_fg_col);
if(flushing_volume_modify){
p->m_flushing_volume_btn->SetStyle(ButtonStyle::Regular, ButtonType::Compact);
p->m_flushing_volume_btn->SetBorderColor(wxColour("#FF6F00"));
}
else
p->m_flushing_volume_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Compact);
}
void Sidebar::enable_buttons(bool enable)
@@ -5103,14 +5090,19 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
return;
}
}
try {
if (originfile != "<lock>") // see bbs_3mf.cpp for lock detail
boost::filesystem::remove_all(last);
}
catch (...) {}
int skip_confirm = e.GetInt();
this->q->new_project(skip_confirm, true);
});
if (this->q->get_project_filename().IsEmpty() && this->q->is_empty_project()) {
int skip_confirm = e.GetInt();
this->q->new_project(skip_confirm, true);
}
});
//wxPostEvent(this->q, wxCommandEvent{EVT_RESTORE_PROJECT});
}
@@ -15071,6 +15063,9 @@ void Plater::export_toolpaths_to_obj() const
p->preview->get_canvas3d()->export_toolpaths_to_obj(into_u8(path).c_str());
}
bool Plater::is_empty_project() {
return model().objects.empty();
}
bool Plater::is_multi_extruder_ams_empty()
{
std::vector<std::string> extruder_ams_count_str = p->config->option<ConfigOptionStrings>("extruder_ams_count", true)->values;