Replace the Design tab's FEATURES label with a Sketch button

This commit is contained in:
SoftFever
2026-10-07 00:30:25 +08:00
parent e4b0828644
commit 505a712f86
2 changed files with 11 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#949494" stroke-width="0.85" stroke-linecap="round" stroke-linejoin="round"><path d="M5.88 3.88H17.16M3.88 5.88V17.16M19.16 5.88V12.38M5.88 19.16H12.38M9.85 7.85H13.2M7.85 9.85V13.2M14.92 9.85A7.35 7.35 0 0 1 9.85 14.92"/><path d="M2.83 2.83h2.1v2.1h-2.1zM18.11 2.83h2.1v2.1h-2.1zM2.83 18.11h2.1v2.1h-2.1zM6.8 6.8h2.1v2.1h-2.1zM14.15 6.8h2.1v2.1h-2.1zM6.8 14.15h2.1v2.1h-2.1z" fill="#949494" stroke="none"/><polygon points="16.01,13.19 18.3,13.19 18.3,16.01 21.12,16.01 21.12,18.3 18.3,18.3 18.3,21.12 16.01,21.12 16.01,18.3 13.19,18.3 13.19,16.01 16.01,16.01" style="fill:#009688;stroke:#009688;stroke-width:0.4;stroke-linejoin:round"/></svg>

After

Width:  |  Height:  |  Size: 747 B

+10 -8
View File
@@ -648,13 +648,12 @@ DesignPanel::DesignPanel(wxWindow* parent)
// delete 42 verbs from the offer while they still rendered. 7ih records the cleanup
// that lets the construction go away too.
// What stays: the view controls, which are chrome_only in the atlas and so have no offer row
// to fall back on.
// to fall back on, and Sketch, the group's lead. All four are built with the doc buttons.
static const std::set<std::string> kBarKeep = { "place", "section", "flip" };
auto fadd = [&tb_slot](const char* id, wxWindow* w) {
if (kBarKeep.count(id) == 0) { w->Hide(); return; }
tb_slot[id].push_back(w);
};
m_tb_feature->Add(caption(_L("FEATURES")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 8);
{
// Onshape-style FEATURE flyouts: same themed-DropDown pattern as the sketch toolbar
// (tinted glyphs, Body_14 measure, content-width popup) but each entry runs an
@@ -732,13 +731,10 @@ DesignPanel::DesignPanel(wxWindow* parent)
fadd(id, chev);
};
auto* b_sketch = icon_btn("design_sketch", _L("Sketch"));
// Sketch opens a sketch on the face or plane already picked, or asks for one first
// (start_sketch): sketch mode is never entered without a plane under it.
std::function<void()> act_sketch = [this] { start_sketch(); };
b_sketch->Bind(wxEVT_BUTTON, [act_sketch](wxCommandEvent&) { act_sketch(); });
m_keys_feature[SHIFT('S')] = act_sketch;
fadd("sketch", b_sketch);
// (start_sketch): sketch mode is never entered without a plane under it. Its button is
// built with the doc buttons below.
m_keys_feature[SHIFT('S')] = [this] { start_sketch(); };
// Add material: every feature that grows new solid material — from a profile
// (extrude/revolve/sweep/loft), from a face (thicken) or from a line (rib).
feat_dropdown("material", "design_extrude", _L("Add material (extrude / revolve / sweep / loft / thicken / rib)"), {
@@ -1638,6 +1634,12 @@ DesignPanel::DesignPanel(wxWindow* parent)
b_export->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_export_step(); });
add_doc(b_export);
// Sketch leads the feature group. Momentary like the imports: start_sketch() may only ask
// for a plane, or refuse, and a teal active-tool state would outlive either.
auto* b_sketch = doc_btn("design_new_sketch", _L("Create a new sketch"));
b_sketch->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { start_sketch(); });
tb_slot["sketch"].push_back(b_sketch);
// These act on bodies / the view, so they ride in the feature group, in the slots
// the user assigned them (9, 11bis, 16).
auto* b_place = doc_btn("toolbar_flatten", _L("Place on Face (F) — lay the picked face on the bed"),