From c22351f63a6d1aa66fc3ca178cf0e575f1d30ed2 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 28 Jun 2026 15:14:15 +0200 Subject: [PATCH] Fix GUI build on mainline OrcaSlicer: DropDown Item API + Bed3D::set_shape Two Snapmaker->mainline API divergences surfaced once the ported CAD subsystem compiled (the whole libslic3r CAD kernel + vendored slvs solver built clean): - DesignPanel: Snapmaker's DropDown took 3 parallel vectors (texts/tips/icons); mainline's is Item-based (std::vector). Collapsed both flyout structs (FeatFlyout, ToolFlyout) to one Item vector. Event/selection path unchanged (both emit wxEVT_COMBOBOX + SetInt). - DesignCanvas: mainline Bed3D::set_shape added extruder_areas/heights params before custom_model; pass empty vectors. Build verified: links clean (orca-slicer, 280/280). Runtime reaches the GTK event loop equivalently to the proven-good snaporca binary; full visual Design-tab verification pending an interactive :10/x11vnc session. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q --- src/slic3r/GUI/DesignCanvas.cpp | 2 +- src/slic3r/GUI/DesignPanel.cpp | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/slic3r/GUI/DesignCanvas.cpp b/src/slic3r/GUI/DesignCanvas.cpp index c268865120..a81fc3b3a1 100644 --- a/src/slic3r/GUI/DesignCanvas.cpp +++ b/src/slic3r/GUI/DesignCanvas.cpp @@ -360,7 +360,7 @@ void DesignCanvas::refresh_bed() double printable_height = 100.0; const auto* ph_opt = config->opt("printable_height"); if (ph_opt) printable_height = ph_opt->value; - m_bed.set_shape(bed_shape_opt->values, printable_height, "", false); + m_bed.set_shape(bed_shape_opt->values, printable_height, {}, {}, "", false); // mainline added extruder_areas/heights params } bool DesignCanvas::is_sketching() const { return m_sketch_tool.is_active(); } diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/DesignPanel.cpp index 2c5ed69c75..cc7e1068fd 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/DesignPanel.cpp @@ -262,22 +262,23 @@ DesignPanel::DesignPanel(wxWindow* parent) // arbitrary action — the existing per-feature handler — instead of selecting a Mode. struct FeatVar { const char* icon; wxString tip; wxString hint; std::function action; }; struct FeatFlyout { - std::vector texts, tips; - std::vector icons; + std::vector items; // mainline DropDown is Item-based (text/tip/icon per row) std::vector> actions; std::vector icon_names; ScalableButton* btn = nullptr; - DropDown drop; // declared LAST: destroyed before the vectors it references - FeatFlyout() : drop(texts, tips, icons) {} + DropDown drop; // declared LAST: destroyed before the vector it references + FeatFlyout() : drop(items) {} }; auto feat_dropdown = [&](const char* def_icon, const wxString& grp, std::vector vars) { auto* b = icon_btn(def_icon, grp); b->SetFont(Label::Body_14); // measure popup labels in the popup's font (no truncation) auto fo = std::make_shared(); for (auto& v : vars) { - fo->texts.push_back(v.tip); - fo->tips.push_back(v.hint); - fo->icons.push_back(tint(create_scaled_bitmap(v.icon, m_form, 18), drop_icon_col)); + DropDown::Item it; + it.text = v.tip; + it.tip = v.hint; + it.icon = tint(create_scaled_bitmap(v.icon, m_form, 18), drop_icon_col); + fo->items.push_back(it); fo->actions.push_back(std::move(v.action)); fo->icon_names.emplace_back(v.icon); } @@ -554,14 +555,13 @@ DesignPanel::DesignPanel(wxWindow* parent) // icon; clicking drops the variants; a small chevron marks it as a group. struct SkVar { const char* icon; DesignSketchTool::Mode mode; wxString tip; wxString hint; }; struct ToolFlyout { - std::vector texts, tips; - std::vector icons; + std::vector items; // mainline DropDown is Item-based (text/tip/icon per row) std::vector modes; std::vector hints; std::vector icon_names; ScalableButton* btn = nullptr; - DropDown drop; // declared LAST: destroyed before the vectors it references - ToolFlyout() : drop(texts, tips, icons) {} + DropDown drop; // declared LAST: destroyed before the vector it references + ToolFlyout() : drop(items) {} }; auto dropdown = [&](const char* def_icon, const wxString& grp, std::vector vars) { auto* b = icon_btn(def_icon, grp); @@ -572,9 +572,11 @@ DesignPanel::DesignPanel(wxWindow* parent) b->SetFont(Label::Body_14); auto fo = std::make_shared(); for (auto& v : vars) { - fo->texts.push_back(v.tip); - fo->tips.push_back(v.hint); - fo->icons.push_back(tint(create_scaled_bitmap(v.icon, m_form, 18), drop_icon_col)); + DropDown::Item it; + it.text = v.tip; + it.tip = v.hint; + it.icon = tint(create_scaled_bitmap(v.icon, m_form, 18), drop_icon_col); + fo->items.push_back(it); fo->modes.push_back(v.mode); fo->hints.push_back(v.hint); fo->icon_names.emplace_back(v.icon);