Skip to main content

button_prefix

Function button_prefix 

Source
pub fn button_prefix(wb: &Workbench) -> String
Expand description

What every one of a workbench’s OWN button ids leads with: its id, lowercased, and a dot — drawing.dim.radius, sheetmetal.flat_pattern.

A button id is all the toolbar’s return path and the workbench_button command carry, so it must name ONE button across every workbench: with an id declared twice, button_by_id returns the first declaration and asks ITS when, and All’s union keeps the first and drops the rest. The prefix makes two workbenches’ ids disjoint. It matters where two workbenches take their buttons from one table: eCAD’s editor actions (view.*, edit.*, sheet.*, board.*) are Diagram’s and PCB’s alike, so each leads them with its own — diagram.sheet.tool.wire, pcb.sheet.tool.wire — while the symbol and pads editors’ ids already lead with symbol. and pads. and need nothing added. The shared sketch tools belong to no workbench and lead with none of theirs (sketch.).