fix(ui): put Point on the default sketch toolbar (#445)
This commit is contained in:
1 parent
809ecf781e
commit
5c7149e57d
5 files changed
+48
-3
No files matched your search
@@ -61,6 +61,8 @@ PCB / Package, Render, Animation, Simulation, Manufacture/CAM, Drawings.
|
||||
|
||||
## Dimensioning and error reporting
|
||||
|
||||
- Point has a default Sketch CREATE toolbar button alongside the existing drawing tools.
|
||||
Saved custom layouts are preserved; Reset Toolbar restores the default Point button.
|
||||
- Construction planes cannot take an origin-plane name (XY, XZ, YZ, Top, Front, Right). Plane
|
||||
arguments reject such a name when an older design's construction plane already has it. Use
|
||||
the other alias, the construction feature's numeric ID or an explicit plane; existing
|
||||
|
||||
@@ -30,7 +30,6 @@ pub fn promoted(tab: &str, panel: &str) -> usize {
|
||||
match (tab, panel) {
|
||||
("SOLID", "CREATE") => 4,
|
||||
("SOLID", "MODIFY") => 4,
|
||||
("SKETCH", "CREATE") => 6,
|
||||
("SKETCH", "CONSTRAINTS") => 6,
|
||||
(_, "FINISH SKETCH") => 1,
|
||||
_ => 2,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Toolbar layout of the tabs that share commands with others (Fusion's layout): the SOLID
|
||||
//! tab's ASSEMBLE panel, SHEET METAL and PLASTIC. A command is registered on one tab and panel;
|
||||
//! Explicit toolbar layouts: Sketch CREATE, the SOLID tab's ASSEMBLE panel, SHEET METAL and
|
||||
//! PLASTIC. A command is registered on one tab and panel;
|
||||
//! these panels list the commands they show in order (the first few get big buttons), so Extrude
|
||||
//! or Joint appear on several tabs. Commands registered on such a panel but not listed follow at
|
||||
//! the end.
|
||||
@@ -100,6 +100,19 @@ pub fn panels(tab: &str) -> Option<&'static [&'static str]> {
|
||||
/// to the registry.
|
||||
pub fn layout<'a>(tab: &str, panel: &str, specs: &[&'a CommandSpec]) -> Option<(Vec<&'a CommandSpec>, usize)> {
|
||||
let (ids, promoted, own_tab): (&[&str], usize, &str) = match (tab, panel) {
|
||||
("SKETCH", "CREATE") => (
|
||||
&[
|
||||
"sketch.line",
|
||||
"sketch.rectangle.two_point",
|
||||
"sketch.rectangle.three_point",
|
||||
"sketch.rectangle.center",
|
||||
"sketch.circle.center",
|
||||
"sketch.circle.two_point",
|
||||
"sketch.point",
|
||||
],
|
||||
7,
|
||||
tab,
|
||||
),
|
||||
("SOLID", "CONFIGURE") => (&["parameters.change", "config.table"], 2, tab),
|
||||
("SOLID" | "SHEET METAL" | "PLASTIC", "ASSEMBLE") => (ASSEMBLE, 3, tab),
|
||||
("SHEET METAL", "CREATE") => (SHEET_CREATE, 3, tab),
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
[
|
||||
{"note":"#191: Point is a default Sketch CREATE button; the existing six drawing buttons remain available."},
|
||||
{"call":"engine.execute","params":{"command":"sketch.create","params":{"plane":"XY"}}},
|
||||
{"expect":{"shown_handles":["button:sketch.line","button:sketch.rectangle.two_point","button:sketch.rectangle.three_point","button:sketch.rectangle.center","button:sketch.circle.center","button:sketch.circle.two_point","button:sketch.point"]}},
|
||||
{"click":{"handle":"button:sketch.point"}},
|
||||
{"expect":{"tool":"sketch.point","dialog":null}},
|
||||
{"click":{"sketch":[20,15]}},
|
||||
{"key":"Escape"},
|
||||
{"expect":{"errors":0,"sketch_world":{"point":"p1","at":[20,15,0]}}},
|
||||
{"call":"ui.menu","params":{"x":400,"y":80,"target":{"type":"toolbar_command","id":"sketch.point"}}},
|
||||
{"call":"ui.menuPick","params":{"item":"Remove from Toolbar"}},
|
||||
{"expect":{"hidden_handles":["button:sketch.point"]}},
|
||||
{"restart":"close"},
|
||||
{"call":"engine.execute","params":{"command":"sketch.create","params":{"plane":"XY"}}},
|
||||
{"expect":{"hidden_handles":["button:sketch.point"]}},
|
||||
{"click":{"handle":"panel:SKETCH:CREATE"}},
|
||||
{"expect":{"shown_handles":["dropdown:sketch.point"]}},
|
||||
{"click":{"handle":"dropdown:sketch.point"}},
|
||||
{"key":"Escape"},
|
||||
{"call":"ui.menu","params":{"x":400,"y":80,"target":{"type":"toolbar"}}},
|
||||
{"call":"ui.menuPick","params":{"item":"Reset Toolbar"}},
|
||||
{"expect":{"shown_handles":["button:sketch.point","button:sketch.line"],"errors":0}},
|
||||
{"call":"ui.resize","params":{"width":640,"height":720}},
|
||||
{"click":{"handle":"panel:SKETCH:CREATE"}},
|
||||
{"click":{"handle":"dropdown:sketch.point"}},
|
||||
{"expect":{"tool":"sketch.point","errors":0}}
|
||||
]
|
||||
@@ -21,6 +21,10 @@ constraint status and **Finish Sketch** button remain visible.
|
||||
|
||||
## Geometry
|
||||
|
||||
**Point** is available directly on the default Sketch **CREATE** toolbar. Click it, then
|
||||
click in the sketch to place a point. Existing toolbar customizations are kept; use
|
||||
**Reset Toolbar** from the toolbar's context menu to restore the default buttons.
|
||||
|
||||
Lines and polylines (L), rectangles (two-point R, three-point, centre), circles (centre C,
|
||||
two-point, three-point, tangent), arcs (three-point, centre, tangent), polygons, slots, ellipses,
|
||||
fit-point and control-point splines, conics, points and text. **Construction** (X) turns curves
|
||||
|
||||
Reference in new issue
Block a user