- StyleCx::state_layer is the one hover and press fill; PartBuilder::state_layer declares a part whose look it is, and the paint step fills such parts under the component's paint (Rating stars, Breadcrumb crumbs, the reset dot). Button's local overlay goes. - The paint step's surface shapes move into one function, which Draw::surface_look also paints for a part. - Check box, radio and switch draw their well on the sunken surface (the bevel in bevelled themes), take the press fill while pressed and the accent's pressed shade while on and pressed. - StyleCx::dropdown: the closed box of Select, TreePicker, PresetPicker and the stroke button takes the hover fill under the pointer and while open. - A focused invalid field keeps its focus edge and draws the failure colour as a line inside it (SurfaceLook::inner). - The selected segment keeps hover and press looks; the disclosure glyph lights under the pointer; the EdgePicker's hovered line widens in its own colour; the chip body wears an outline badge, so it takes the hover fill. - SurfaceLook::kind_on: the kind a look takes while on.
craft-draw
Vector and shape tools for Craft apps. With the ui feature, craft_draw::ui has the pen, crop and free transform overlays (below), the gradient tools (GradientEditor, GradientPalette, GradientSwatch, GradientRamp, the stop rules in gradient::stops, the on-canvas GradientOverlay with its gradient_line geometry, and the GradientMapEditor) and these tools and panels, each in its own module with its labels:
stroke:StrokeEditor,StrokeButtonandStrokePreviewoverStrokeStyle;corner:CornerWidgetsfor corner radii;shapeandshape_drag:ShapePanel,ShapeBar,ShapeDragToolandCreateShapeDialog;slice:SliceTool,SliceOverlay,SliceBarand the Slice Options and Divide Slices dialogs;artboardandadd_beside:ArtboardTool,ArtboardBar,ArtboardPropertiesand the add-beside buttons;connector:ConnectorTool,ConnectorOverlayandConnectorBar;patternandpicture_fill:PatternFillEditor,PatternFillDialogandPictureFillEditor;transform:TransformSessionwithTransformOverlay,TransformBarand the Transform menu words;crop:CropTool,CropSessionandCropBarbeside theCropFrame;measure:RulerTool,RulerBarandbox_distances;symmetry:SymmetrywithSymmetryOverlay,SymmetryMenuandSymmetryTransform;brush_presetsandbrush_settings:BrushPresetPicker,BrushPresetChipandBrushSettingsPanel(its answer isBrushSettingsPanelOutput).
The main types of every module are re-exported at craft_draw::ui.
The gradient editor uses the colour picker and wells of craft-color.
ui::pen, ui::crop and ui::transform hold the canvas overlays of the Pen, Crop and Free Transform tools. They sense through craft_ui::canvas (CanvasView, Claim, PartFocus, quad):
TransformBox draws Free Transform's box over the guides (a bare 1 pt line, 8 square handles, the reference point) and runs its gestures through quad::drag (PhotoCraft's rules by default; BoxRules, RotateZone and inside_moves set DesignCraft's, VectorCraft's or a Move tool's): the nearest handle within 12 pt, drags reported as edit gestures, a click outside or a double-click inside or Enter applies, Esc undoes a drag and then discards the box, the arrows move the picked part, an optional readout shows the angle, scale or move; one Tab stop whose Page keys pick the whole box, a corner, an edge or the reference point, each an AccessKit object named by the host's TransformNames. A host that runs its own input calls hit, press, track and release (canvas points, modifiers, the view; BoxPress is the state it keeps between press and release) and gets the box show would give; paint_pivot draws the reference point for a host that shows one outside the box. BezierOverlay draws paths (EditPath: subpaths of Knots, each an anchor with in and out handles; PathSelection is the host's) with their anchors and direction handles and edits them as Direct Selection (select, ⇧ toggle, ⌥ subpath, drag anchors, handles and segments, a marquee on empty canvas) or Convert Point does, reporting PathEdits for the host to apply; one Tab stop whose Page keys pick anchors and their handles, arrows move them, Insert and Delete report anchors to add and remove; above MAX_ANCHORS anchors it draws outlines only. PenDraft draws the path being drawn with the Pen and runs its gestures (click for a corner anchor, drag for symmetric handles, ⇧ at 45°, ⌥ breaks the pair, a press on the last anchor retracts its handle, a press on the first closes the path, a press on an open path's end resumes it) and keys (Enter and Esc end the path and keep it, Backspace and PenDraft::remove_last take back the last anchor), reporting the whole draft as an EditSubpath edit gesture; it is not a Tab stop and its anchors are AccessKit objects named by the host's PenNames.