diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 4b936d05e..c4afb4b30 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -52,6 +52,8 @@ Editable drawing code, native projects and shipped exports are collected under ` | docs/book/src/generated/enclosure.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/enclosure.json`; gitignored) | MIT OR Apache-2.0 | | docs/book/src/generated/revolve.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/revolve.json`; gitignored) | MIT OR Apache-2.0 | | docs/book/src/generated/sheet-metal.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/sheet-metal.json`; gitignored) | MIT OR Apache-2.0 | +| assets/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf | IBM Corp. (IBM Plex Mono) | https://github.com/IBM/plex (via google/fonts), unmodified; licence text in assets/fonts/ibm-plex-mono/OFL.txt; the interface monospace font | SIL OFL 1.1 | +| assets/fonts/ibm-plex-sans/IBMPlexSans-Variable.ttf | IBM Corp. (IBM Plex Sans, variable wdth and wght) | https://github.com/IBM/plex (via google/fonts), unmodified; licence text in assets/fonts/ibm-plex-sans/OFL.txt; the default interface font | SIL OFL 1.1 | | docs/book/src/generated/tool-preview.png | SolidCraft contributors | rendered by `cargo xtask book` (`solidcraft-cli snapshot docs/book/scripts/tool-preview.json`; gitignored) | MIT OR Apache-2.0 | | assets/fonts/liberation-sans/LiberationSans-Regular.ttf | Red Hat, Inc. (Liberation Fonts 2.x; digitized data Google) | https://github.com/liberationfonts (Debian fonts-liberation), unmodified; licence text in assets/fonts/liberation-sans/OFL.txt; used for sketch Text outlines | SIL OFL 1.1 | | assets/fonts/biz-udp-gothic/BIZUDPGothic-Regular.ttf | The BIZ UDGothic Project Authors | https://github.com/googlefonts/morisawa-biz-ud-gothic (Google Fonts), unmodified; licence text in assets/fonts/biz-udp-gothic/OFL.txt; used for web UI Japanese font | SIL OFL 1.1 | @@ -78,6 +80,8 @@ Editable drawing code, native projects and shipped exports are collected under ` | assets/appearances/library.rs | SolidCraft contributors | Original SolidCraft resource data or drawing code, collected without redesign | MIT OR Apache-2.0 | | assets/fonts/biz-udp-gothic/OFL.txt | The BIZ UDGothic Project Authors | Unmodified accompanying font licence | SIL OFL 1.1 | +| assets/fonts/ibm-plex-mono/OFL.txt | IBM Corp. | Unmodified accompanying font licence | SIL OFL 1.1 | +| assets/fonts/ibm-plex-sans/OFL.txt | IBM Corp. | Unmodified accompanying font licence | SIL OFL 1.1 | | assets/fonts/liberation-sans/OFL.txt | Red Hat, Inc.; Liberation Fonts contributors | Unmodified accompanying font licence | SIL OFL 1.1 | | assets/icons/app/linux/exports/hicolor/128x128/apps/ai.storyteller.solidcraft.png | SolidCraft contributors | Generated from assets/icons/app/shared/source/app_icon.rs with the original CLI/ICO encoders | MIT OR Apache-2.0 | | assets/icons/app/linux/exports/hicolor/16x16/apps/ai.storyteller.solidcraft.png | SolidCraft contributors | Generated from assets/icons/app/shared/source/app_icon.rs with the original CLI/ICO encoders | MIT OR Apache-2.0 | @@ -137,6 +141,7 @@ Editable drawing code, native projects and shipped exports are collected under ` | assets/icons/ui/design/palette.toml | SolidCraft contributors | icon colour roles (light and dark) and accents, original SolidCraft data | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/bug_report.svg | SolidCraft contributors | single-colour application/navigation icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/chevron.svg | SolidCraft contributors | single-colour application/navigation icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | +| assets/icons/ui/design/svg/flat/chevron_right.svg | SolidCraft contributors | single-colour application/navigation icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/close.svg | SolidCraft contributors | single-colour application/navigation icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/disclosure_closed.svg | SolidCraft contributors | single-colour application/navigation icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/disclosure_open.svg | SolidCraft contributors | single-colour application/navigation icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | @@ -287,6 +292,8 @@ Editable drawing code, native projects and shipped exports are collected under ` | assets/icons/ui/design/svg/model/silhouette.svg | SolidCraft contributors | original icon master (64 grid) | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/assistant.svg | SolidCraft contributors | original icon master (64 grid) | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/flat/agent_link.svg | SolidCraft contributors | original icon master (64 grid) | MIT OR Apache-2.0 | +| assets/icons/ui/design/svg/model/offset_two_sides.svg | SolidCraft contributors | original icon master (64 grid) | MIT OR Apache-2.0 | +| assets/icons/ui/design/svg/model/offset_symmetric.svg | SolidCraft contributors | original icon master (64 grid) | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/model/placeholder.svg | SolidCraft contributors | two-tone modelling icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/model/plane.svg | SolidCraft contributors | two-tone modelling icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | | assets/icons/ui/design/svg/model/plane_angle.svg | SolidCraft contributors | two-tone modelling icon master (64 grid), original SolidCraft artwork | MIT OR Apache-2.0 | @@ -422,6 +429,7 @@ Editable drawing code, native projects and shipped exports are collected under ` | assets/icons/ui/design/tools/lint_icons.py | SolidCraft contributors | icon lint, status page or preview tool (standard-library Python), original SolidCraft code | MIT OR Apache-2.0 | | assets/icons/ui/design/tools/preview.py | SolidCraft contributors | icon lint, status page or preview tool (standard-library Python), original SolidCraft code | MIT OR Apache-2.0 | | assets/icons/ui/design/tools/review_state.py | SolidCraft contributors | icon review state helper (standard-library Python), original SolidCraft code | MIT OR Apache-2.0 | +| assets/icons/ui/design/requested_icons.txt | SolidCraft contributors | Runtime icon requests collected by the headless menu audit, original SolidCraft data | MIT OR Apache-2.0 | | assets/icons/ui/design/review.json | SolidCraft contributors | icon review state (accepted icons and notes), original SolidCraft data | MIT OR Apache-2.0 | | assets/icons/ui/design/tools/author/lib.py | SolidCraft contributors | icon authoring script (standard-library Python), original SolidCraft code | MIT OR Apache-2.0 | diff --git a/Cargo.lock b/Cargo.lock index f3891452c..3860bdafc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4379,6 +4379,7 @@ dependencies = [ "solidcraft-engine", "solidcraft-gpu", "solidcraft-space-mouse", + "syn 2.0.119", "tiny-skia", "toml", "ttf-parser", diff --git a/assets/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf b/assets/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf new file mode 100644 index 000000000..0c9770d51 Binary files /dev/null and b/assets/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf differ diff --git a/assets/fonts/ibm-plex-mono/OFL.txt b/assets/fonts/ibm-plex-mono/OFL.txt new file mode 100644 index 000000000..c35c4c618 --- /dev/null +++ b/assets/fonts/ibm-plex-mono/OFL.txt @@ -0,0 +1,93 @@ +Copyright © 2017 IBM Corp. with Reserved Font Name "Plex" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/ibm-plex-sans/IBMPlexSans-Variable.ttf b/assets/fonts/ibm-plex-sans/IBMPlexSans-Variable.ttf new file mode 100644 index 000000000..30f837e8b Binary files /dev/null and b/assets/fonts/ibm-plex-sans/IBMPlexSans-Variable.ttf differ diff --git a/assets/fonts/ibm-plex-sans/OFL.txt b/assets/fonts/ibm-plex-sans/OFL.txt new file mode 100644 index 000000000..c35c4c618 --- /dev/null +++ b/assets/fonts/ibm-plex-sans/OFL.txt @@ -0,0 +1,93 @@ +Copyright © 2017 IBM Corp. with Reserved Font Name "Plex" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/icons/ui/AGENTS.md b/assets/icons/ui/AGENTS.md index 29f0973f7..e88a8d7df 100644 --- a/assets/icons/ui/AGENTS.md +++ b/assets/icons/ui/AGENTS.md @@ -29,3 +29,9 @@ request files under target, and do not retry them. The server never invokes a mo Canonical paths, launch command and export schema: [README.md](README.md). There are no numbered bulk authoring scripts or generated inventory files to maintain. + +Runtime discovery is also checked by `crates/ui-egui/tests/icon_audit.rs`. New menu +surfaces must extend that Harness traversal. Regenerate the committed +`design/requested_icons.txt` with `UPDATE_ICON_MANIFEST=1 cargo test -p +solidcraft-ui-egui --test icon_audit`; review the sorted id/placeholder diff. The +review tool reads this fixture in addition to source scans, masters and aliases. diff --git a/assets/icons/ui/README.md b/assets/icons/ui/README.md index 28cb8c830..8e4aede02 100644 --- a/assets/icons/ui/README.md +++ b/assets/icons/ui/README.md @@ -18,8 +18,8 @@ artwork changes trigger the live revision check. The server binds only to loopba Every opening scans SVG masters, aliases and source references. New, unused, missing and changed icons are discoverable. **All discovered icons without a valid -acceptance are Open, including those with notes.** No inventory file or allowlist -is needed. Rescan sees additions immediately; a running page also polls revisions. +acceptance are Open, including those with notes.** Discovery also reads `design/requested_icons.txt`, the sorted runtime audit +manifest; it supplements source scans and never restricts discovery. Rescan sees additions immediately; a running page also polls revisions. The internal placeholder glyph is the only excluded card. Shared masters are shown separately even when an accepted alias already uses them; reopen that alias before requesting a redraw of its protected artwork. Unassigned commands @@ -82,6 +82,7 @@ Palette changes preserve accepted artwork and never update review hashes. | `design/palette.toml`, `aliases.toml` | Shared theme roles, weights and semantic aliases | | `design/review.json` | Owner acceptance hashes and current notes | | `design/references.toml` | Curated style references; does not control discovery | +| `design/requested_icons.txt` | Sorted runtime requests and placeholder flags, checked by the Harness audit | | `design/tools/author/{lib,bases}.py` | Reusable geometry and canonical cube/slab/arrow bases | | `design/tools/author/new_icon.py` | Safe new-master scaffold, never overwrites an id | | `design/tools/icon_status.py`, `review_state.py` | Discovery, review backend and state | @@ -104,5 +105,25 @@ python3 -B assets/icons/ui/design/tools/icon_status.py --csv ``` Reports, screenshots, requests, generated contact sheets and previews stay under -ignored `target/`. Do not commit generated inventories or historical authoring -batches. Every non-Markdown resource has an exact row in `ATTRIBUTION.md`. +ignored `target/`. The runtime request manifest is a committed regression fixture; other generated +inventories and historical authoring batches do not belong in the repository. Every non-Markdown resource has an exact row in `ATTRIBUTION.md`. + +## Runtime menu audit + +`cargo test -p solidcraft-ui-egui --test icon_audit` drives the real UI through the +headless scenario Harness and rejects placeholder requests and unexpected blank +context-menu icons. It compares sorted requested ids with +`design/requested_icons.txt` (`idplaceholder`, one per line). After deliberately +changing menu coverage or assignments, regenerate and review its diff: + +```sh +UPDATE_ICON_MANIFEST=1 cargo test -p solidcraft-ui-egui --test icon_audit +``` + +The review page includes every manifest id, even ids used only in tables or helper +arguments. A true placeholder flag, missing master or broken alias is reported as +missing; runtime collection never changes acceptance hashes. The live control +method `ui.icon_audit` can diagnose requests in a running UI (see +[control protocol](../../../docs/control-protocol.md)). Keep the Harness traversal +current when adding menus. A successful traversal covers only the contexts it +actually opens; document unreachable or untested contexts in the audit report. diff --git a/assets/icons/ui/STYLE_GUIDE.md b/assets/icons/ui/STYLE_GUIDE.md index 00fa94798..33c91585a 100644 --- a/assets/icons/ui/STYLE_GUIDE.md +++ b/assets/icons/ui/STYLE_GUIDE.md @@ -207,3 +207,9 @@ All artwork must be original SolidCraft work or an explicitly licensed resource with provenance. Commercial CAD artwork, screenshots and extracted assets are forbidden even as hidden references. This guide and the local finished set provide all required visual context for future agents. + +Runtime discovery is also checked by `crates/ui-egui/tests/icon_audit.rs`. New menu +surfaces must extend that Harness traversal. Regenerate the committed +`design/requested_icons.txt` with `UPDATE_ICON_MANIFEST=1 cargo test -p +solidcraft-ui-egui --test icon_audit`; review the sorted id/placeholder diff. The +review tool reads this fixture in addition to source scans, masters and aliases. diff --git a/assets/icons/ui/design/aliases.toml b/assets/icons/ui/design/aliases.toml index f3443077c..adb998138 100644 --- a/assets/icons/ui/design/aliases.toml +++ b/assets/icons/ui/design/aliases.toml @@ -35,4 +35,12 @@ sketch_scale = { master = "scale", accent = "sketch" } sketch_text = { master = "text", accent = "sketch" } surface_fair = { master = "spline_cv", accent = "surface" } mesh_export = { master = "export", accent = "mesh" } + +# Legacy feature-history id for the same Split Body operation. +split = "split_body" + +# Sketch dialog choices share the corresponding finished tool artwork. +sketch_chamfer_equal = { master = "sketch_chamfer", accent = "sketch" } +sketch_chamfer_two = { master = "sketch_chamfer_two_distances", accent = "sketch" } +offset_one_side = { master = "offset", accent = "sketch" } bom = "list" diff --git a/assets/icons/ui/design/palette.toml b/assets/icons/ui/design/palette.toml index e648a8128..aaed95b24 100644 --- a/assets/icons/ui/design/palette.toml +++ b/assets/icons/ui/design/palette.toml @@ -10,7 +10,7 @@ [roles.ink] # outlines and details drawn over a face source = "#34465b" light = "#34465b" -dark = "#d8dfeb" +dark = "#1f2021" [roles.line] # line art that sits directly on the UI background (SVG: currentColor) source = "#34465b" light = "#34465b" @@ -66,13 +66,13 @@ parameters = 4.2 [accents.surface.active-1] light = "#f1d2af" -dark = "#ba8f6a" +dark = "#cc9362" [accents.surface.active-2] light = "#c06f00" -dark = "#b86f04" +dark = "#bd750d" [accents.surface.active-3] light = "#a45000" -dark = "#95682d" +dark = "#955a0e" [accents.form.active-1] light = "#decff8" @@ -85,41 +85,41 @@ light = "#7349cd" dark = "#7b63a6" [accents.mesh.active-1] -light = "#e5d99b" -dark = "#a9985f" +light = "#ffec8e" +dark = "#ffe282" [accents.mesh.active-2] -light = "#a28200" -dark = "#9a8100" +light = "#bb9600" +dark = "#ab8f00" [accents.mesh.active-3] -light = "#826700" -dark = "#857100" +light = "#e0b200" +dark = "#c6a800" [accents.sketch.active-1] light = "#bfe2cc" -dark = "#81a28e" +dark = "#7ab792" [accents.sketch.active-2] light = "#439a65" -dark = "#459665" +dark = "#3a965e" [accents.sketch.active-3] light = "#057f45" -dark = "#27864e" +dark = "#128d45" [accents.constraint.active-1] light = "#f0cfca" dark = "#b98c88" [accents.constraint.active-2] light = "#c1685f" -dark = "#b66b61" +dark = "#c27267" [accents.constraint.active-3] -light = "#af4038" -dark = "#a05c54" +light = "#ca473d" +dark = "#c16358" [accents.construction.active-1] light = "#ecd3b6" -dark = "#b19373" +dark = "#b99a78" [accents.construction.active-2] light = "#b8741f" -dark = "#b4711c" +dark = "#ad7023" [accents.construction.active-3] light = "#9c5600" dark = "#a75d00" @@ -134,12 +134,16 @@ dark = "#1d7f89" [variants.red-green.construction.active-3] light = "#b97300" dark = "#a75d00" +# The constraint red stays darker than the sketch green for a weak red sense. +[variants.red-green.constraint.active-3] +light = "#af4038" +dark = "#c16358" [variants.blue-yellow.construction.active-3] light = "#b97300" dark = "#c37d00" [variants.blue-yellow.constraint.active-3] light = "#af4038" -dark = "#986255" +dark = "#85554a" # Default accent by requested icon id. Explicit alias accents in aliases.toml win. # Deliberately not inherited from a master: ground reuses c_fix but is not a constraint. @@ -153,9 +157,9 @@ sketch = [ "arc3", "arc_center", "arc_slot", "arc_slot_center", "arc_tangent", "blend", "circle", "circle2", "circle3", "circle_tt", "circle_ttt", "conic", "constrainer", "dimension", "ellipse", - "extend", "finish", "fit_section", "include", "infinite", + "extend", "finish", "fit_section", "include", "intersect", "intersection_curve", "iso_curve", "line", "line_mid", - "offset", "point", "polygon", "polygon_circumscribed", "polygon_edge", + "offset", "offset_two_sides", "offset_symmetric", "point", "polygon", "polygon_circumscribed", "polygon_edge", "project", "project_surface", "rect", "rect3", "rect_center", "rect_rounded", "sketch", "sketch_chamfer", "sketch_chamfer_angle", "sketch_chamfer_two_distances", "sketch_fillet", "sketch_mirror", "slot", "slot_center", "slot_overall", @@ -168,5 +172,5 @@ constraint = [ "c_polygon", "c_smooth", "c_symmetry", "c_tangent", ] construction = [ - "centerline", "construction", + "centerline", "construction", "infinite", ] diff --git a/assets/icons/ui/design/requested_icons.txt b/assets/icons/ui/design/requested_icons.txt new file mode 100644 index 000000000..57761b34e --- /dev/null +++ b/assets/icons/ui/design/requested_icons.txt @@ -0,0 +1,282 @@ +accessibility false +activate false +align false +appearance false +arc3 false +arc_center false +arc_slot false +arc_slot_center false +arc_tangent false +as_built false +assistant false +auto_constrain false +axis false +axis_edge false +axis_normal_to_face false +axis_through_cylinder false +axis_two_planes false +axis_two_points false +bendtable false +blend false +body false +bom false +boss false +boundary_fill false +bounding_solid false +box false +break false +bug_report false +c_coincident false +c_collinear false +c_concentric false +c_equal false +c_fix false +c_hv false +c_midpoint false +c_parallel false +c_perpendicular false +c_polygon false +c_smooth false +c_symmetry false +c_tangent false +cam false +camera false +canvas false +capture false +center_of_mass false +centerline false +chain false +chamfer false +checkpoint false +chevron false +chevron_right false +circle false +circle2 false +circle3 false +circle_tt false +circle_ttt false +close false +coil false +combine false +compare false +component false +compute false +configuration_table false +conic false +constrainer false +construction false +contact_all false +contact_new false +contact_off false +contact_sets false +continuity false +convert_sheet false +copy false +curvature_comb false +curvature_map false +cut false +cylinder false +decal false +delete false +delete_face false +dimension false +disclosure_closed false +disclosure_open false +draft false +draft_analysis false +drive false +dxf false +edit false +ellipse false +emboss false +environment_map false +error false +explode false +export false +extend false +extrude false +eye false +fastener false +fillet false +finish false +fit false +fit_section false +flange false +flat false +fold false +folder false +gear false +graph false +ground false +help false +hem false +hole false +home false +import false +include false +infinite false +inspect false +interference false +intersect false +intersection_curve false +iso_analysis false +iso_curve false +joint false +joint_origin false +library false +line false +line_mid false +lip false +list false +loft false +lookat false +material false +measure false +mesh_export false +min_radius false +mirror false +motion_link false +move false +new false +normal false +offset false +offset_face false +offset_one_side false +offset_symmetric false +offset_two_sides false +open false +orbit false +origin false +pan false +params false +paste false +pattern_center false +pattern_circ false +pattern_flip false +pattern_path false +pattern_rect false +perforate false +perspective false +pipe false +plane false +plane_along_path false +plane_angle false +plane_midplane false +plane_perpendicular false +plane_tangent false +plane_three_points false +plane_two_edges false +plastic_assign false +plastic_rule false +play false +plus false +point false +point_along_path false +point_center false +point_edge_plane false +point_three_planes false +point_two_edges false +point_vertex false +polygon false +polygon_circumscribed false +polygon_edge false +presspull false +project false +project_surface false +rack_pinion false +reach false +rect false +rect3 false +rect_center false +rect_rounded false +redo false +refold false +rename false +render_image false +render_scene false +reorder false +replace_face false +rest false +restore false +revert false +revolve false +rib false +rigid_group false +rollback false +save false +scale false +screw false +section false +select false +settings false +sheet_rules false +shell false +silhouette false +sketch false +sketch_break false +sketch_chamfer false +sketch_chamfer_angle false +sketch_chamfer_equal false +sketch_chamfer_two false +sketch_chamfer_two_distances false +sketch_circ_pattern false +sketch_dxf false +sketch_fillet false +sketch_mirror false +sketch_move false +sketch_rect_pattern false +sketch_scale false +sketch_text false +slot false +slot_center false +slot_overall false +snap false +snap_fit false +sphere false +spin false +spline false +spline_cv false +split false +split_body false +split_face false +spun false +star false +status_error false +style false +suppress false +surface_blend false +surface_boundary false +surface_extend false +surface_extrude false +surface_fair false +surface_fillet false +surface_loft false +surface_offset false +surface_patch false +surface_reverse_normal false +surface_revolve false +surface_ruled false +surface_stitch false +surface_sweep false +surface_thicken false +surface_trim false +surface_unstitch false +surface_untrim false +svg false +sweep false +text false +thread false +torus false +trace false +trim false +undo false +unfold false +update false +warning false +web false +ws_animate false +ws_design false +ws_drawing false +ws_render false +zebra false +zoom false diff --git a/assets/icons/ui/design/review.json b/assets/icons/ui/design/review.json index 784b14c3a..eb886ca08 100644 --- a/assets/icons/ui/design/review.json +++ b/assets/icons/ui/design/review.json @@ -15,9 +15,9 @@ "as_built": "0f481932deca5586a8a8ea3d707efca0747f5c59559d53830b694d3458531013", "assistant": "8fac392b16b4f13c6a399c59962b97c1912282e0ec909976496959472f1d642d", "auto_constrain": "012e5da4ff83449f6a3a92ee2d9924998cbeea545281bdf97873710b7436183d", - "axis": "66ebabe43a7b1b73b59a3a03b7bd92ab54d899947d0cc2d93ad6e6aac4d76501", + "axis": "acdab0eb7b99b1579d64ae190082df48b65174e7b8ad3104967bcc59f6154206", "axis_edge": "5a65898bc38bdaaaf5b04f2c2f7556915b5b7b1fdc4de9708fcc30f64aa1ab18", - "axis_normal_to_face": "0824bb37e80928e9ac880af5ca5fdb3b52084af9e73db73a5a5a7bc8f1f899f7", + "axis_normal_to_face": "597b5b96ce787b70791133267108c5196aca09d5e3f94e7dc92199a63fe49ca6", "axis_through_cylinder": "804eb75631f4ee71ac8db51209237bb19d82bafd326abdc81b124b875c0874b4", "axis_two_planes": "80162aa79ca7baf6d60490414a4fb53d87e6f2b85e901c452875a5f3ed86d35a", "axis_two_points": "5064f7544ce41ae7c1f05a90c958222bbcee03723df67d34cd3e209d25a1f71f", @@ -30,36 +30,38 @@ "boundary_fill": "17ccb419a46c04a44ec864af968a32984dc81f6b3196a821bfff7f54141dfdd1", "bounding_solid": "e2deb6fff292f0f295022583ba7ddb86896eb79d9dd7268e653713b9c62f0580", "box": "72cd44c3c4fc5ae71242fca8c60af47371930201276df5b7db9d2f16a2739c31", - "break": "430582243311f304dbab397ce58c8c9aef9c78ed88d3e921a57e584ddb95d94c", + "break": "67a5fab332616e6d6a9aeae3bedc04ee0768179143ba34b795bdd98cea04bb24", "bug_report": "8cf7afbe0d3c34988fd2748de148f56a7e939fd8273ba01a79a976f879c74831", - "c_coincident": "32fb535b3dd7631dc2e9ea284f445ad54ea0e5c8b0e1bb27a9984c849746917d", + "c_coincident": "a93cc58acc5090c24c973cb558920bff4e35c8f99071135f16a115256d41bf98", "c_collinear": "3bcf1dc6b221a1fa9a4445ee8afc7d858dc28a5270d22d10fef86fa4997f1bdf", "c_concentric": "90e9b35b6186ea4fcb3debc24808f302c0bf7354b7afae86e339574ef8e5103a", "c_equal": "c0f50c02db7d15a6392d2178e28df5c100e67fab7732f8e8474b888d218d0673", - "c_fix": "b91c6af7ea9740efb8cf196409b11d16fad52c51b732a356e5f844bd4e2f08e0", + "c_fix": "23e2471a9d6872e83028e0e219e330cef1930a4d89456a0fefa1bda8a7e3eb81", "c_hv": "b5c44d60a4b03b9942fbcf3c706f797ce4dbddf9a67eb1c98d6aaf3234e9bc18", - "c_midpoint": "fd4efc26da1336f811a9016b02d7675af2a7c95cd1ffa2f091507b22434f5435", + "c_midpoint": "aaea530b8a04aa80efc99ed2cf42347a91c65b160286bae3e2882f5a0bd09a51", "c_parallel": "aaa80258502af091b596511662aca392546dd0d7bf69cec4db98b6e0ae7591f0", - "c_perpendicular": "692ba7a77cd77108c33c101386b60b7c957ce7d2202937d9696d18dcf3d4cf8e", - "c_polygon": "defac40b4c6ef323494f49acbb94b896502f78f6a99e750975693c602164a44b", - "c_smooth": "dccf5effdb8977ac04e6c437c280c83ed0f117d81b64c57fae03f5f7f7f2b9c0", + "c_perpendicular": "0ccf0383176ace2d4ab30c2efe853815ca1df20f2537020f369f496d8bf124b5", + "c_polygon": "02c76b288b42d6be8eb77f502af95bb840557f43fed3def2b1a381f6ac920375", + "c_smooth": "87aeb504aa330a191a8680d9eab3e86844f6d7be0a9caa10fdf0a657e76f45ee", "c_symmetry": "8646a7deb7447514bcc455562d8639f8b4c482df8c971fd2870c05965ce71f78", - "c_tangent": "a011f5d43d5e09f68de332c60c5acee737a3ebc94d107f521871225c3841a064", + "c_tangent": "ef8b1e502c2a939958b5e8de9ef2716442e32b2a394555eb7b51101c415b966e", "cam": "a35342e36ca4deae55e98c54df630b5c2da591c06d979eb2b8ce6a13f6db66d0", "camera": "fcd867877ea4984318dbff36a166b48682f26bb9d44e70383dde63d9a7ab87c8", "canvas": "512d7721f0b8b14a46f22b9588b437b0cd8c2c425330d31b3b156c0d1334bcef", "capture": "23ef84e50b45c06532b3e842b72f6da5498d0e6b8391e1bff55e84afa8359f37", "center_of_mass": "24401b1a19cb45ddb028de0acf3c9815b47abecbde9e133f473adac3d27ae346", - "centerline": "a1889b9092ef5a7aa9592df994b6541b53ea9afb03b2c56c7678a61df335f4d7", + "centerline": "850283497bad77e233f934e8effc0d0d7b01ccde83fa66f6abb539a33a8a2c80", "chain": "9cdc78486b5c4b5b2a378e09bbd41733eb167513f9f2bc4b1aad629dd6c4c753", "chamfer": "487c90ae65e87b74d7ddee7d9ce9f088b63e9b5b85c2a390364855a2649f17e8", "checkpoint": "a3bc0700a40b791b5f3bf176d820bdabd2cf94a526908609d50136c8d0918d6a", "chevron": "61887736af4b1e6bef857c4d2e3846657824e84f1c8026a56525ddba2d2a8083", + "chevron_right": "d28a52dcc51fd9eb988f8f83e89d74370a31100049c910a886732a48ec1342ca", "circle": "145544ff1cd133971f537dd247092126ef8d91a88fe31b795222e76840d0c4d0", "circle2": "f1b6e8e2157279cfe1e608f913b377e44a70f7555f5010298138de8a887bf586", "circle3": "aaf6b914e630688675abf4dcbf7d43096317881ced0e22520a4ef229013e0de2", "circle_tt": "94996320b671c8c48f239b8c48f1b2f1cd5cc33a7d8ea1daaa61aa9203803cae", "circle_ttt": "ac3c211a6fe17c3625060f695ecd93937730e2bc2dd57921bcbbcaa984b9badf", + "close": "5833954dfba3d70a9a3a7519f2796a7213899548b0345bd8fe8ea9a321d82be2", "coil": "4c549fd63506457165f53a7940cc0f3dcacdbe075e935ea299edbf4985104411", "combine": "f9d4211f0153779369c9da68b266c2c9a857d11bc033ff4a96ede794e470e38e", "compare": "c24b6c18f18413ae6f3344aaa6e04b42fae8b63e7cd1552a81398462eb68eb96", @@ -68,7 +70,7 @@ "configuration_table": "1a142e76b9e4cd47412a307cc0ad9b8c589bb97c8930fc445dd5bb8d74ecf707", "conic": "808445fd697ff76f9074e7bbf877146e634995c295dce045604991fa4cec26a0", "constrainer": "774cb158897eb91767541b5b1a25a46f3a731cbea0661006ce5472634ab6b0e3", - "construction": "ad962cbcd0aaef9167744abfd0bfe1d7ef55e48b4ff42f2b4b05f66204b58acb", + "construction": "f13e3851cdf7b30a7118802a1c17e8852fcb9893fd1d65c7098a5c3fc35c8396", "contact_all": "6ad4d245592815a3e38e70ae324ad3971ab614daba7ca3cf8fcb64cb8e2be077", "contact_new": "603410785fff408cc12dc72bef2f09885b694c5ddb2571c7819ae1301fb89dc6", "contact_off": "54dc3bd2267ebb084d8dc7efee85e9f21d8c59a57ad37b96d78095bc75e73fa0", @@ -83,8 +85,10 @@ "decal": "acc258e40b29ffb6b6007057f0b70f487995f573704c7ef4e4f08f209d52bddd", "delete": "d14203f06b8b1b87328e7f198c7aa41595e9a66b5d8a7fbd2a3ec2e35cd99afd", "delete_face": "dcbf8ab59bd37bd5a0cdd7a528b29c2d19daa5f3fc130ef5cff0c20034f061a4", - "dimension": "8246dde8b0a140d1f533c1e45f2e8b5af35c05d3504dccf50bd7e7726a93389e", - "dots": "aa38423c547594462f49cc355f3c9f5b41e28a7515f466a6a8cffda487ba1715", + "dimension": "a926b7c64bc8ca99d8d6dcbb81b95235bd3fc34fbed049aca8b01b4d1147c15d", + "disclosure_closed": "49a350c6f2efae78de0be96c524ebee1fd1291ea449a84224b88d37164a4e807", + "disclosure_open": "d13ce3f97e3e362a9904fa2bf3412f3f00e4136bc23538b92d41483961d280de", + "dots": "600f7ff209d93145fc938bc4f6a1e34473e6b9ee22a5b4718f133bc7da5ee58d", "draft": "9c0fc361cacd0ad95ccd54794f4825dfc9901a83a3de752a588faec365d0ee09", "draft_analysis": "eb39c0f90e9cf226da6307365a76015e900dd692dc3f0fdc8f02fe717226261f", "drive": "cf9e924acb2531efd5a1b90915d59f0cb532c844b754fd3a0e376ef6f706c47d", @@ -99,6 +103,7 @@ "export": "c8c2abf007e43e896479d78798e3976ba9eda809507c820bb38538f77db696ac", "extend": "28c63df352c77d02feffe44cf09fb0fc1d48f7905aaabbfa6dba601dbb70f8e8", "extrude": "9cc1538971c5d25467aaed23f739899d9d102fd07f86472ac3197c54ca2e1144", + "eye": "2449167c8410826dc1106b687c12a309d5bea8f7817b897943e80f182a163c2d", "fastener": "fcff4e4be50907f712e527b373771afafd92e50096fc7a4b8aba5d86448e1e42", "fillet": "11ec232dc111597211e3a4fe61b69616b5d28b4b1b2732052ddcd486cdfc6129", "filter": "4d456a56416089574bd3732fa44c0c1b27fd2478b369448808a27f0144d15d8a", @@ -110,15 +115,15 @@ "fold": "90344fb5e5799378117fbd79ef28a84f27fba5723af5414c4ea30a2ac3a4f21e", "folder": "c19f5230df45a1bda1e92e89de38bba21c91e6eca0517eb15847a7712012d1e5", "gear": "25a1ca48a587850da1104a46005a330873ed196246e3d04e12cf61f26ad2b0d5", - "graph": "25646bdf4d1a534c51e1897a8ae641a21f871ed70b24ff25652e1fe957c9fa00", - "ground": "b91c6af7ea9740efb8cf196409b11d16fad52c51b732a356e5f844bd4e2f08e0", + "graph": "7156caedd2dbfa2ae53da18b7a2204b8db66c45126859d36caf049a3fd4335a4", + "ground": "23e2471a9d6872e83028e0e219e330cef1930a4d89456a0fefa1bda8a7e3eb81", "help": "8ce4060577483dbdb510be147d2827de50ac20029354008fca55abc0c7edf05d", "hem": "f9b1aafbedcf3dc90c26be308814638e0095fbe31b0647092507343fa60af011", "hole": "f82d47751f826e08682db847a270897474661bfe9f35b6d3678f49a203172563", "home": "ab5f1c41d377687e4c5a808dfdccf2757b33dd43f934d44df43d6e9118176853", "import": "e343540eb49fdb1e53c4d54b9e60ae513b3103df6c9133048bed878e58067455", "include": "f5b80ad3e06e3b863fcfbe415ec912e4e09653dd519f9ac207819339fe34730f", - "infinite": "bff57a1c56d9b47131d7c8ff85f008a53c612c63706052e7e19d7aaea93cf5b1", + "infinite": "53fb781131078d2f8e71be23aa610d9f9d9c8bb79ba5f97fa397475e9ff8c3bd", "inspect": "d2b4644b2d5f1aa50cb576b9265e275fa91201e296c2bc79865f810067d538e9", "interference": "b3d729d0e822e8d95485c8ef50649847572def10d4c713fff0e073b8031c5f5d", "intersect": "9ab4f6551848a2be546f55502a77075bed2d3994f89d91b721eab92bcee61d61", @@ -126,7 +131,7 @@ "iso_analysis": "dacd34ac254ec4fbb6932350f62d4d92626d922a2bfc62d2caecdeb17303e896", "iso_curve": "015ff2e26346ccaf149f75cf6a0652d9201c1b23a14e6bb62625acfa599dc002", "joint": "72b71a608e713f6cf51a1cb84edb011d4ccbd8bfe41d917fa2a1d13345dc0b2b", - "joint_origin": "5b0761122eb4295ea220314e8db1efd1251e3482653d6cdcc47252d0268864a8", + "joint_origin": "e12529af1fce8c5ffdf746e71ce2f5db5eb170e53778469cea8fd30344291574", "library": "ac0b1798e4c94340f9c854daa3829371c1a9f3ffea7679d955e6cfa139cafdc8", "line": "cd1177ea659548f03d43c7fa7dcc209a0542b1ba4bd0153c5113576cb7a96a81", "line_mid": "edb8ebc463479ae9878e54b930c124153ca880270b7cf6c0e4edba6336ba2854", @@ -140,17 +145,20 @@ "min_radius": "92bd79b7d557aba6ddfccc76a4c6d0cfb579061b3c57172f9171d28af675711c", "mirror": "56637068a319dc2972c5552b25e4f43151aa9bd5055c2fef08204dd7cc0829cf", "moon": "3ba5adb92bf0f49e92d46682dbf6905e555aa6eebc8e2b3c5288f949cda29322", - "motion_link": "19698bbe15b7c2d2601208bbcdc26627d1aa7724aee017b7da8874ad87fb9d1f", + "motion_link": "27832f827146446557609336a9b9e48e649ed84e58c45bd9032a93abbd454104", "move": "4132e270ada8d0c79b477095c84d656d6d354e200c1748ce7fc425f36d0b7031", "nav_settings": "b93dd46d3a3d074e0d8834167f977dab417fbc1a721bc4db5e840732304e4193", "new": "c64c78fd8445bc7b2aa8765d0507b9adf23e35cbf52828d3f1987edccce0389f", - "normal": "1148cef2d60a858b69406a2e2527d4ea126f45846de7cc2fb3a96640e9ee226f", + "normal": "3c000d707837d4e9c865aefa43c1e610bfce5a06a38510f82e4db11fc13ab31f", "offset": "094607afcfdcb9c1410114d9f8d22ca367f8e32ab4c61f71affe44ad5d09adbe", "offset_face": "83d39308ec9f3ead78329c62841c8899bbc76ce08e17d539016d18c91d9d4ea7", + "offset_one_side": "094607afcfdcb9c1410114d9f8d22ca367f8e32ab4c61f71affe44ad5d09adbe", "offset_surface": "b501cfb56b8404cdb2275935d780ce7dbb67e87e29ade3782f0859c59070a2b1", + "offset_symmetric": "67f3489402af3afa055181bbdb2a32b9fe2e0d96dccbe0f28df087577978ac9c", + "offset_two_sides": "ef69f955c5bef15471e9d77a4498e9337bf938ad75dcbc1e95af2515b6fd13da", "open": "f1880d25489753f7e40390902037bbd3195fbd099a5e9dd175797d832abff727", "orbit": "4adcd400cdde909139386e78579433354f65f5a77a0594447bf6dda663b3b1b4", - "origin": "9b9360edc16ef9f059bff7d863f1bc0e3abac6acf559d76c4ea39dc374ab2844", + "origin": "636f9f41654a6da7a5a708bcddef85672f2d77bfec2267b0134e8c5a59768b40", "pan": "2465eda7a39d4458d7818f2eb2b033992a68f80d9505bff538b41eb4511bb632", "params": "d0d9d0b3e786880e59b985dc2e3a7d593cf3771484a8fd2924d69155195c230f", "paste": "e1b3c089adafacb6f7b78b86ec7aba0876b189c81d01031045dfee2c47ae8edc", @@ -165,22 +173,23 @@ "perspective": "5fa45ba9b75dbe9fdad9eae331ca7ff35c6ad018b8a1fc4c8ae7bcfc13ed0c3f", "pipe": "b9ecf1ae9f6790e2ae6c677f290446f70eba1773a10247fe33d5283b360b0403", "plane": "3e7fa0a9d57891f3c1ec03d7422bdb29353d3487deed12e8ec5737aeb33c2f3a", - "plane_along_path": "020e25969a7f4e7e3358003addee7df8b1991cde8401df0b4df8295b19497994", + "plane_along_path": "db4686ea02c3c3b8ad0d9eac203cc050c395cff6358358922a79c00e955e6852", "plane_angle": "2f0914955663b393a377fda080bc03dc5a2133d42c506c1908c53b2fd609b156", "plane_midplane": "66bd880821e7b122f130824313b7070d72d79168a52df6a126106b6eb5816474", - "plane_perpendicular": "90e1d9b8e75743821aa1082596d9c3f288ab3baddf087fbae3f2025481e58a6e", + "plane_perpendicular": "0055fb18ee39044bfc9f2ac53ba55fe73d8fe59e8f4cf225ee2c723a883d3085", "plane_tangent": "c3872b9f1d0f0b2493a5488dfdad50049c3422c29023250088eeda9bbcc6e795", "plane_three_points": "08e2dbaf606d165ef4f788869fc794a4fbbbb2ee86a60017b76e467af6da338a", - "plane_two_edges": "1588b8d4741382d9e8fec38212419ac1c05b1bc6036f276d3b5c62db66f8ebdb", + "plane_two_edges": "21de401ec5bab8ae37510da6fa0a6910325f858c17460da0041fd26897338d30", "plastic_assign": "bbfdb2d2c07629c047e8e671c7c032654668a67b4b8a934f74cbb3d7a00cc5fe", "plastic_rule": "51b8591d92907a3ffb76a47a0503d7ba86706d129dd990515a364dbf1ab8cb48", "play": "d1c17ebc16e9a4ee5ae2a8cc37b515ffcc8c53a2ab17117959e9b21278df8def", + "plus": "4f324157bb2348ac9f09346b669b08d66ed96cb1c694f33db6f21134f18904b5", "point": "fd19dbcd26e2a898267bab54b9d89779d97894209c1771317d7debef5a6f8f5d", - "point_along_path": "1fd58d45285fb5cabeddbd35bc8485af1b6d7f1414e302202b4e73de593d1b7a", + "point_along_path": "17abd16dec5f70e9f8449c927aa995cfed10fca552ec7cd8f51b209c52012595", "point_center": "0ad755896f7d0154a854bda16d3059da78d1fae57962e13a3bb1b31e284b7e79", - "point_edge_plane": "548a6c1c944caabe44ab0318e85ae82f39c11f74fbedda35f57bc6615755f249", + "point_edge_plane": "a277bc0b87f2dd39eb613835d0f961b3372483e22053e6a522a06c535ad530c4", "point_three_planes": "b33c7508ffa67b66a57b72c6ea7900e93ff16362a29d0b2688e0b1db9bfad041", - "point_two_edges": "35dcb67b36c8e41041cc836b01056731ab6f14c5e3b4bdd836fbee2a1dd897e3", + "point_two_edges": "da329241706e405b877cec20639dc0a78505ca7212c7c47ad1f1f34aa26f4666", "point_vertex": "649bb63caf65a3fbc00a1222cc642294832b5e5d8c4d33f812e09a70684c4abe", "polygon": "4919268cca7d21ce98dbf4ca01ee832350e793afe4213e257d3c46e94ea88ad1", "polygon_circumscribed": "7e4ad16cc1f42c599287b186f26f4ff3c108736877a571a5513bfc72d0cbb23f", @@ -214,17 +223,19 @@ "scale": "a66f69d9a1d46c8be30da0a15827bc7e38cba72d6271537763b888c2c7e2b3fa", "screw": "5e30570785360d6a591ea22862a82f1cf62228385c1e96382536db8a453ac791", "section": "cdd13f99f15f6d59bfa21c747810608d6afd00cb8207faf0337928c8521e7eae", - "select": "a0c716234ef1d599be9a7654d6b2911ebe4b2de479383ba33aeab14992443a2f", + "select": "fdf6431270006ca7409c60c37cfed59572de04229f104ec723e6010ffa2b7163", "settings": "9193dd3a1007c43660d0d47b6499cb2571338b67949e1a99df112057b9bf2b8a", "sheet": "774e30923ef6f37dd9c0b2bc3e45705e83b3a76700bf071cd41155a365d0daa4", - "sheet_rules": "b8c3a67c82be20fc00c109decc566e8755d70167e04e0a9fb92941f7b27aa993", + "sheet_rules": "5d3a2f37d3b4a4262b3ddbdae53d61f29e0f8e284dd54006da25a7acebfa1114", "shell": "a1959ea0d0441a479bf654b6e549e2e44a0bfdc9cda4eb46fe1fbfd884de7e38", "silhouette": "2a848aed2f247b1c0439f830a34a513c93bc5493c40044c821d493d863ad996e", "sketch": "b52e5862b1709a9a7e3ca00d7436d126fbfc01b38080006fa4e17dc581dfa103", - "sketch_break": "430582243311f304dbab397ce58c8c9aef9c78ed88d3e921a57e584ddb95d94c", + "sketch_break": "67a5fab332616e6d6a9aeae3bedc04ee0768179143ba34b795bdd98cea04bb24", "sketch_chamfer": "80ab27a9929f9cf0ab2f827757e007173d74ddca6c19af238931c40d4cd874b4", - "sketch_chamfer_angle": "b853f5e7c3b008c0d56ac445a9a28f713987c919ea284945113ad35e7665e2a7", - "sketch_chamfer_two_distances": "2b70d658e341f4388838f3c8c579ec5f4f3a7fddcfa2ce7a3f89fc3db6422d6e", + "sketch_chamfer_angle": "6750268d05e0b0fd74c2d0368bf4703b09da825def668dc3dfd05deef3ba9adb", + "sketch_chamfer_equal": "80ab27a9929f9cf0ab2f827757e007173d74ddca6c19af238931c40d4cd874b4", + "sketch_chamfer_two": "1f5ecf1283e2b021e067ed2e4e2e97aa4e1ad3c7c98d8609bb81c5f811988f78", + "sketch_chamfer_two_distances": "1f5ecf1283e2b021e067ed2e4e2e97aa4e1ad3c7c98d8609bb81c5f811988f78", "sketch_circ_pattern": "c5ff904237a3072f858f66c2777febc4facd2fee630bbf979047c5685d9a05ce", "sketch_dxf": "dddce44d4dd10f75a221208fcf431b36b3f0cafce6611fc695ac73afb4bf5789", "sketch_fillet": "e8fa170e5f6899abf75788b9384d49f2b9d77ba9b644f79309284a9e65629fe1", @@ -242,6 +253,7 @@ "spin": "a5bebeff8276dd12ab7e42ddf0051370b9063fb602607298acf22e77044434d1", "spline": "a0dcb25614e5fe1a8f17bc3bddbb11b61cf82b461dd46443ab28cddd6e4e32e3", "spline_cv": "353f6e411c0ce611f660cef2e4fc4f8f55edc2c82288de91948dc638cd2b5f15", + "split": "eb9619e74c6ee1b1989d35a2e31d2d33a7adac210c4cd424e5382902945ac68b", "split_body": "eb9619e74c6ee1b1989d35a2e31d2d33a7adac210c4cd424e5382902945ac68b", "split_face": "c8b89072118bb7a28b243d38e26b81a796781a631f30b3b1fc296ba23e4d908d", "spun": "b4cfa093ffb43611ee124f4a39fb44c609deb9cde5e05e4dfbaf893fe197c27b", @@ -250,6 +262,7 @@ "status_warning": "1ac4f0ccfac2c01f6f66cb42188f9ae053c4aef9c5bbd249f1fb09611eb4d825", "stitch": "6c3205d64007b771ed78d6f8055867578439fb25d591563b32dbd3343c98732d", "style": "6c2b04234b82ea4858c80190cc7208c60f549358253005afc35ab4e29506b578", + "suppress": "c54fbc01c12c0175d78cd63f692e8aaf73fc2cac79752b2a3ad821ac32734343", "surface": "ba0e839ce0ee03e7ff95a2389a5ecb20bd80c713064d9b1bd5f461f4a80d1921", "surface_blend": "0642f3b4af7d22f379a3c74f54c7b1c9eef0bdda19372ce4df73c0e56bdd7bbc", "surface_boundary": "fb8501bae192e2416118cc2e88f544e0e29197f6720bccc541c967ca0848d8d3", @@ -265,14 +278,14 @@ "surface_ruled": "c3f0202d3beaacef0368765ce771eb9e3b0e3e157f86564c72d81f0fad9a3cab", "surface_stitch": "6c3205d64007b771ed78d6f8055867578439fb25d591563b32dbd3343c98732d", "surface_sweep": "6d7f18c12b2e4c1dbe3632fe08239687f6f027b29b6dddbf8c8e2d9151c7baf3", - "surface_thicken": "676eb73a99d708214e8951ebe2c4d88d60de2d752c725d8106d12fbd812e461a", + "surface_thicken": "35aaa8e4fdbcd220a3a05165d5230a7ce576fbf5a6a5772d27162ab61bb71538", "surface_trim": "ae269721b386bd1264184b9838df3240b5b6ba02b99c9993384ef21200fb7398", "surface_unstitch": "bd8302fe95a89eb6f9bbf35ef0ee98c8a2186e160cff3d091f8cf2a0a75d4473", "surface_untrim": "24de5d558519e0629280d11919ba5661c92ccdccdce03f8f3d83f2d7867c2173", "svg": "7da77d53c84db18ce95737ad633c105d1009444b3192a5e0aae76873cfc9cc12", "sweep": "6d7f18c12b2e4c1dbe3632fe08239687f6f027b29b6dddbf8c8e2d9151c7baf3", "text": "9d31b72b16644681c8a86ac257511847ad69ce4351cf6960442222e94b168c4a", - "thicken": "676eb73a99d708214e8951ebe2c4d88d60de2d752c725d8106d12fbd812e461a", + "thicken": "35aaa8e4fdbcd220a3a05165d5230a7ce576fbf5a6a5772d27162ab61bb71538", "thread": "158728c3dcf6623bb1584d162398bb12c28d18770e0d47f5e6328355ce31b37c", "torus": "5ae13fc213582e0844118b910a3a26efd9e4b177d21500363fbae230803cb4fd", "trace": "5f2ecc61d4591d3c3b0ecccd35296b8613fce7beb2ae214fb906160c31d89187", @@ -284,7 +297,7 @@ "update": "c675e16df4c78589a00be4a34f98627500681672ee8a668e929aec50982da3cc", "warning": "1ac4f0ccfac2c01f6f66cb42188f9ae053c4aef9c5bbd249f1fb09611eb4d825", "web": "be5cd95bebcd0ebe257f9eb862112124429b381ef4a2f0849938fac7c9ccc619", - "ws_animate": "d36a0834ad989a6e16e2b0db493ad8867c590caedf0442c51eff19e934c887f8", + "ws_animate": "f34f187850789cc4f141b1ace114082be04edec8e7771d6730fec1cef19c7f64", "ws_design": "7b1dd678a2d018892b965a78932c047bbfff6b4439d7bd9fe85c09a995f97581", "ws_drawing": "61e99c7179f3448a31b8c76392334352ec3d5e39b0b92fe5244940146d0986cb", "ws_render": "1bfe474d1742623ad2142129e4d6a40015e674813eb1db401d2e88e55b1f2a03", @@ -292,6 +305,9 @@ "zoom": "89c121fa85df034d70bd9f06e20cbd54d163691d4df03b13a9ac5372e951aeda" }, "notes": { - "pattern_flip": "This feels sparse. Improve the composition" + "construction": "Fix the bottom dot's position", + "infinite": "Make the infinity symbol use the 'Line art' colour", + "pattern_flip": "This feels sparse. Improve the composition", + "sheet_rules": "Make the top line also blue" } } diff --git a/assets/icons/ui/design/svg/flat/chevron_right.svg b/assets/icons/ui/design/svg/flat/chevron_right.svg new file mode 100644 index 000000000..e07c0d022 --- /dev/null +++ b/assets/icons/ui/design/svg/flat/chevron_right.svg @@ -0,0 +1,4 @@ + + Chevron right + + diff --git a/assets/icons/ui/design/svg/model/axis.svg b/assets/icons/ui/design/svg/model/axis.svg index 79434aeb9..6090eb91f 100644 --- a/assets/icons/ui/design/svg/model/axis.svg +++ b/assets/icons/ui/design/svg/model/axis.svg @@ -4,5 +4,5 @@ - + diff --git a/assets/icons/ui/design/svg/model/axis_normal_to_face.svg b/assets/icons/ui/design/svg/model/axis_normal_to_face.svg index efddcd567..aa60b7a8d 100644 --- a/assets/icons/ui/design/svg/model/axis_normal_to_face.svg +++ b/assets/icons/ui/design/svg/model/axis_normal_to_face.svg @@ -6,5 +6,5 @@ - + diff --git a/assets/icons/ui/design/svg/model/break.svg b/assets/icons/ui/design/svg/model/break.svg index 614bed30d..43d5f0a88 100644 --- a/assets/icons/ui/design/svg/model/break.svg +++ b/assets/icons/ui/design/svg/model/break.svg @@ -3,5 +3,5 @@ - + diff --git a/assets/icons/ui/design/svg/model/c_coincident.svg b/assets/icons/ui/design/svg/model/c_coincident.svg index 01bc385e4..23712c129 100644 --- a/assets/icons/ui/design/svg/model/c_coincident.svg +++ b/assets/icons/ui/design/svg/model/c_coincident.svg @@ -1,6 +1,6 @@ Coincident - - + + diff --git a/assets/icons/ui/design/svg/model/c_fix.svg b/assets/icons/ui/design/svg/model/c_fix.svg index 7de87c238..fce9b3ce3 100644 --- a/assets/icons/ui/design/svg/model/c_fix.svg +++ b/assets/icons/ui/design/svg/model/c_fix.svg @@ -2,5 +2,5 @@ Fixed - + diff --git a/assets/icons/ui/design/svg/model/c_midpoint.svg b/assets/icons/ui/design/svg/model/c_midpoint.svg index e2a504a6e..37e098982 100644 --- a/assets/icons/ui/design/svg/model/c_midpoint.svg +++ b/assets/icons/ui/design/svg/model/c_midpoint.svg @@ -1,6 +1,6 @@ Midpoint - + diff --git a/assets/icons/ui/design/svg/model/c_perpendicular.svg b/assets/icons/ui/design/svg/model/c_perpendicular.svg index 56bfc50ce..8b7280e04 100644 --- a/assets/icons/ui/design/svg/model/c_perpendicular.svg +++ b/assets/icons/ui/design/svg/model/c_perpendicular.svg @@ -2,5 +2,5 @@ Perpendicular - + diff --git a/assets/icons/ui/design/svg/model/c_polygon.svg b/assets/icons/ui/design/svg/model/c_polygon.svg index 918d59de2..fa36be406 100644 --- a/assets/icons/ui/design/svg/model/c_polygon.svg +++ b/assets/icons/ui/design/svg/model/c_polygon.svg @@ -1,6 +1,6 @@ Regular polygon - - + + diff --git a/assets/icons/ui/design/svg/model/c_smooth.svg b/assets/icons/ui/design/svg/model/c_smooth.svg index 972a625e2..999f01d21 100644 --- a/assets/icons/ui/design/svg/model/c_smooth.svg +++ b/assets/icons/ui/design/svg/model/c_smooth.svg @@ -1,6 +1,6 @@ Curvature - + - + diff --git a/assets/icons/ui/design/svg/model/c_tangent.svg b/assets/icons/ui/design/svg/model/c_tangent.svg index 896566029..5bd8392e8 100644 --- a/assets/icons/ui/design/svg/model/c_tangent.svg +++ b/assets/icons/ui/design/svg/model/c_tangent.svg @@ -1,5 +1,5 @@ Tangent - + diff --git a/assets/icons/ui/design/svg/model/centerline.svg b/assets/icons/ui/design/svg/model/centerline.svg index d839cff64..bd1b7b06d 100644 --- a/assets/icons/ui/design/svg/model/centerline.svg +++ b/assets/icons/ui/design/svg/model/centerline.svg @@ -1,9 +1,9 @@ Centerline - + - - - - + + + + diff --git a/assets/icons/ui/design/svg/model/construction.svg b/assets/icons/ui/design/svg/model/construction.svg index 76d509885..bae8ebc36 100644 --- a/assets/icons/ui/design/svg/model/construction.svg +++ b/assets/icons/ui/design/svg/model/construction.svg @@ -1,7 +1,6 @@ Construction - - - - + + + diff --git a/assets/icons/ui/design/svg/model/dimension.svg b/assets/icons/ui/design/svg/model/dimension.svg index fb51381db..a54f43b82 100644 --- a/assets/icons/ui/design/svg/model/dimension.svg +++ b/assets/icons/ui/design/svg/model/dimension.svg @@ -1,6 +1,6 @@ Dimension - + diff --git a/assets/icons/ui/design/svg/model/dots.svg b/assets/icons/ui/design/svg/model/dots.svg index 0aa05f310..3e8f0a136 100644 --- a/assets/icons/ui/design/svg/model/dots.svg +++ b/assets/icons/ui/design/svg/model/dots.svg @@ -1,6 +1,6 @@ More - - - + + + diff --git a/assets/icons/ui/design/svg/model/graph.svg b/assets/icons/ui/design/svg/model/graph.svg index 215ce7553..2de6c208f 100644 --- a/assets/icons/ui/design/svg/model/graph.svg +++ b/assets/icons/ui/design/svg/model/graph.svg @@ -1,6 +1,6 @@ Dependency graph - + diff --git a/assets/icons/ui/design/svg/model/infinite.svg b/assets/icons/ui/design/svg/model/infinite.svg index 55bca1e95..20619d8d7 100644 --- a/assets/icons/ui/design/svg/model/infinite.svg +++ b/assets/icons/ui/design/svg/model/infinite.svg @@ -1,9 +1,9 @@ Infinite line - - - - + + + + - + diff --git a/assets/icons/ui/design/svg/model/joint_origin.svg b/assets/icons/ui/design/svg/model/joint_origin.svg index aa8114d0c..24799a9ef 100644 --- a/assets/icons/ui/design/svg/model/joint_origin.svg +++ b/assets/icons/ui/design/svg/model/joint_origin.svg @@ -13,5 +13,5 @@ - + diff --git a/assets/icons/ui/design/svg/model/motion_link.svg b/assets/icons/ui/design/svg/model/motion_link.svg index 5fa9c6266..e48e5eaa0 100644 --- a/assets/icons/ui/design/svg/model/motion_link.svg +++ b/assets/icons/ui/design/svg/model/motion_link.svg @@ -14,6 +14,6 @@ - - + + diff --git a/assets/icons/ui/design/svg/model/normal.svg b/assets/icons/ui/design/svg/model/normal.svg index 97f3d7fb1..84d15407e 100644 --- a/assets/icons/ui/design/svg/model/normal.svg +++ b/assets/icons/ui/design/svg/model/normal.svg @@ -1,4 +1,4 @@ Normal line - + diff --git a/assets/icons/ui/design/svg/model/offset_symmetric.svg b/assets/icons/ui/design/svg/model/offset_symmetric.svg new file mode 100644 index 000000000..e767ce99d --- /dev/null +++ b/assets/icons/ui/design/svg/model/offset_symmetric.svg @@ -0,0 +1,6 @@ + + Symmetric offset + + + + diff --git a/assets/icons/ui/design/svg/model/offset_two_sides.svg b/assets/icons/ui/design/svg/model/offset_two_sides.svg new file mode 100644 index 000000000..75f9555ee --- /dev/null +++ b/assets/icons/ui/design/svg/model/offset_two_sides.svg @@ -0,0 +1,6 @@ + + Two independent offset sides + + + + diff --git a/assets/icons/ui/design/svg/model/origin.svg b/assets/icons/ui/design/svg/model/origin.svg index 1379189ce..23af9e99f 100644 --- a/assets/icons/ui/design/svg/model/origin.svg +++ b/assets/icons/ui/design/svg/model/origin.svg @@ -2,10 +2,10 @@ Origin - - - - + + + + diff --git a/assets/icons/ui/design/svg/model/plane_along_path.svg b/assets/icons/ui/design/svg/model/plane_along_path.svg index 193935e43..36ea58973 100644 --- a/assets/icons/ui/design/svg/model/plane_along_path.svg +++ b/assets/icons/ui/design/svg/model/plane_along_path.svg @@ -1,6 +1,6 @@ Plane along path - + - + diff --git a/assets/icons/ui/design/svg/model/plane_perpendicular.svg b/assets/icons/ui/design/svg/model/plane_perpendicular.svg index d205e87da..1e9abb9f6 100644 --- a/assets/icons/ui/design/svg/model/plane_perpendicular.svg +++ b/assets/icons/ui/design/svg/model/plane_perpendicular.svg @@ -3,5 +3,5 @@ - + diff --git a/assets/icons/ui/design/svg/model/plane_two_edges.svg b/assets/icons/ui/design/svg/model/plane_two_edges.svg index 89e80fe6d..cd6c34b9d 100644 --- a/assets/icons/ui/design/svg/model/plane_two_edges.svg +++ b/assets/icons/ui/design/svg/model/plane_two_edges.svg @@ -1,6 +1,6 @@ Plane through two edges - - + + diff --git a/assets/icons/ui/design/svg/model/point_along_path.svg b/assets/icons/ui/design/svg/model/point_along_path.svg index 37b4bd66a..53acd98e4 100644 --- a/assets/icons/ui/design/svg/model/point_along_path.svg +++ b/assets/icons/ui/design/svg/model/point_along_path.svg @@ -1,6 +1,6 @@ Point along path - + diff --git a/assets/icons/ui/design/svg/model/point_edge_plane.svg b/assets/icons/ui/design/svg/model/point_edge_plane.svg index 8b8b93035..ec94d02ec 100644 --- a/assets/icons/ui/design/svg/model/point_edge_plane.svg +++ b/assets/icons/ui/design/svg/model/point_edge_plane.svg @@ -1,9 +1,9 @@ Point at edge and plane - + - + diff --git a/assets/icons/ui/design/svg/model/point_two_edges.svg b/assets/icons/ui/design/svg/model/point_two_edges.svg index b4844e884..9f81d196f 100644 --- a/assets/icons/ui/design/svg/model/point_two_edges.svg +++ b/assets/icons/ui/design/svg/model/point_two_edges.svg @@ -1,6 +1,6 @@ Point through two edges - + diff --git a/assets/icons/ui/design/svg/model/select.svg b/assets/icons/ui/design/svg/model/select.svg index 461b436e7..b9528a63d 100644 --- a/assets/icons/ui/design/svg/model/select.svg +++ b/assets/icons/ui/design/svg/model/select.svg @@ -1,4 +1,4 @@ Select - + diff --git a/assets/icons/ui/design/svg/model/sheet_rules.svg b/assets/icons/ui/design/svg/model/sheet_rules.svg index bc7391993..b72d7bce3 100644 --- a/assets/icons/ui/design/svg/model/sheet_rules.svg +++ b/assets/icons/ui/design/svg/model/sheet_rules.svg @@ -6,7 +6,7 @@ - + diff --git a/assets/icons/ui/design/svg/model/sketch_chamfer_angle.svg b/assets/icons/ui/design/svg/model/sketch_chamfer_angle.svg index bcebd81af..b38ccb1df 100644 --- a/assets/icons/ui/design/svg/model/sketch_chamfer_angle.svg +++ b/assets/icons/ui/design/svg/model/sketch_chamfer_angle.svg @@ -2,7 +2,7 @@ Distance and angle sketch chamfer - + diff --git a/assets/icons/ui/design/svg/model/sketch_chamfer_two_distances.svg b/assets/icons/ui/design/svg/model/sketch_chamfer_two_distances.svg index 323fbd9ea..76d5f717c 100644 --- a/assets/icons/ui/design/svg/model/sketch_chamfer_two_distances.svg +++ b/assets/icons/ui/design/svg/model/sketch_chamfer_two_distances.svg @@ -2,7 +2,7 @@ Two distance sketch chamfer - + diff --git a/assets/icons/ui/design/svg/model/thicken.svg b/assets/icons/ui/design/svg/model/thicken.svg index e72ea9e49..089485534 100644 --- a/assets/icons/ui/design/svg/model/thicken.svg +++ b/assets/icons/ui/design/svg/model/thicken.svg @@ -2,8 +2,8 @@ Thicken - - + + @@ -11,9 +11,9 @@ - + - - + + diff --git a/assets/icons/ui/design/svg/workspace/ws_animate.svg b/assets/icons/ui/design/svg/workspace/ws_animate.svg index d53cfbb81..048485c9c 100644 --- a/assets/icons/ui/design/svg/workspace/ws_animate.svg +++ b/assets/icons/ui/design/svg/workspace/ws_animate.svg @@ -1,9 +1,9 @@ Animate workspace - + - + diff --git a/assets/icons/ui/design/tools/icon_status.py b/assets/icons/ui/design/tools/icon_status.py index f0c9fbaab..f2c08d1cd 100644 --- a/assets/icons/ui/design/tools/icon_status.py +++ b/assets/icons/ui/design/tools/icon_status.py @@ -9,7 +9,7 @@ --out FILE Self-contained static review page (default target/icon-status.html) Read assets/icons/ui/STYLE_GUIDE.md before editing artwork. SVGs are authoritative. -Every discovered non-final icon is Open; no inventory file controls discovery. +Every discovered non-final icon is Open; artwork, source and runtime requests are discovery sources. """ import sys, os, re, glob, html, json, hashlib, collections, tomllib, uuid, datetime @@ -36,6 +36,7 @@ def art_rev(): paths += glob.glob(ROOT + '/crates/ui-egui/src/**/*.rs', recursive=True) paths += glob.glob(HERE + '/*.py') paths += [D + '/palette.toml', D + '/aliases.toml', __file__] + paths += glob.glob(D + '/requested_icons.txt') for path in sorted(paths): # Equal-length edits can share an mtime. Only the content identifies what # the reviewer saw; file metadata must never authorize stale acceptance. @@ -58,6 +59,24 @@ def ui_icon_names(source): names.update(re.findall(r'\("[^"]*",\s*"([a-z][a-z0-9_]*)",\s*"[^"]*"\)', table.group(1))) return names +def requested_icons(): + """Runtime ids recorded by the Harness audit; flags describe its last actual render.""" + path = os.path.join(D, 'requested_icons.txt') + if not os.path.exists(path): + return {} + requested = {} + with open(path, encoding='utf-8') as manifest: + for number, line in enumerate(manifest, 1): + if not line.strip() or line.startswith('#'): + continue + fields = line.strip().split('\t') + if len(fields) != 2 or not re.fullmatch(r'[a-z][a-z0-9_]*', fields[0]) or fields[1] not in ('true', 'false'): + raise ValueError(f'{path}:{number}: expected icon_idtrue|false') + if fields[0] in requested: + raise ValueError(f'{path}:{number}: duplicate requested icon {fields[0]}') + requested[fields[0]] = fields[1] == 'true' + return requested + def scan(): """Everything derived from the repo: rows, summary.""" pal = tomllib.load(open(D + '/palette.toml', 'rb')) @@ -86,6 +105,9 @@ def scan(): t = open(f, encoding='utf-8').read() for name in ui_icon_names(t): uses[name].append('ui:' + os.path.relpath(f, ROOT + '/crates/ui-egui/src').replace(os.sep, '/')) + runtime = requested_icons() + for name in runtime: + uses[name].append('ui:runtime audit') mk = ROOT + '/assets/icons/ui/source/markers.rs' if os.path.exists(mk): for name in re.findall(r'=> "(c_[a-z_]+)"', open(mk, encoding='utf-8').read()): uses[name].append('ui:sketch constraint glyph') @@ -95,7 +117,7 @@ def scan(): rows = [] for n in sorted(set(uses) | set(masters) | set(alias_raw)): m, acc = alias_of(n) - if m in masters and n != 'placeholder': status = 'done' + if m in masters and n != 'placeholder' and not runtime.get(n, False): status = 'done' else: status, m = 'placeholder', 'placeholder' cmds = [u for u in uses.get(n, []) if not u.startswith('ui:')] rows.append(dict(id=n, status=status, master=m, accent=acc, commands=len(cmds), example=cmds[0] if cmds else '', diff --git a/assets/icons/ui/design/tools/lint_icons.py b/assets/icons/ui/design/tools/lint_icons.py index 6c7fe532c..fd95ad704 100644 --- a/assets/icons/ui/design/tools/lint_icons.py +++ b/assets/icons/ui/design/tools/lint_icons.py @@ -15,7 +15,7 @@ files = sorted(glob.glob(d + '/svg/*/*.svg')) for path in Path(d).rglob('*'): if not path.is_file(): continue rel = path.relative_to(d).as_posix() - allowed = (rel in {'palette.toml', 'aliases.toml', 'review.json', 'references.toml'} + allowed = (rel in {'palette.toml', 'aliases.toml', 'review.json', 'references.toml', 'requested_icons.txt'} or path.suffix == '.md' or (rel.startswith('svg/') and path.suffix == '.svg') or (path.parent in {Path(d) / 'tools', Path(d) / 'tools/author'} and path.suffix == '.py') @@ -79,6 +79,36 @@ if os.path.exists(references): if name not in names and name not in al: err(references, name + ': reference artwork is missing') for message in icon_palette.validation_errors(pal, names | set(al)): err(d + '/palette.toml', message) +# the review page lies its icons on the real app surfaces: its colours must be the app's tokens +def app_tokens(): + src = open(os.path.join(d, '..', '..', '..', 'styles', 'ui', 'palettes.rs'), encoding='utf-8').read() + lo, hi = src.index('pub const fn light'), src.index('pub const fn dark') + light_src, dark_src = src[lo:hi], src[hi:] + def pick(block, name, dark): + pat = (r'\bt\.%s = Color32::from_rgb\((\d+), (\d+), (\d+)\)' if dark else r'\b%s: Color32::from_rgb\((\d+), (\d+), (\d+)\)') % name + m = re.search(pat, block) + return None if not m else '#%02x%02x%02x' % tuple(int(x) for x in m.groups()) + out = {} + for name in ('toolbar', 'panel', 'border', 'text', 'text_dim', 'viewport_top'): + out[name] = (pick(light_src, name, False), pick(dark_src, name, True) or pick(light_src, name, False)) + return out +css_path = os.path.join(d, 'tools', 'review', 'review.css') +if os.path.exists(css_path): + try: + tok = app_tokens() + css = open(css_path, encoding='utf-8').read() + want = { + ':root{': {'--bg': tok['panel'][0], '--fg': tok['text'][0], '--card': tok['toolbar'][0], '--line': tok['border'][0], '--mut': tok['text_dim'][0]}, + 'body.dark{': {'--bg': tok['viewport_top'][1], '--fg': tok['text'][1], '--card': tok['toolbar'][1], '--line': tok['border'][1], '--mut': tok['text_dim'][1]}, + } + for block, values in want.items(): + line = next((l for l in css.split('\n') if l.startswith(block)), '') + for var, hexv in values.items(): + m = re.search(re.escape(var) + r':(#[0-9a-fA-F]{6})', line) + if not m or m.group(1).lower() != hexv: + err(css_path, '%s%s is %s, the app token is %s (palettes.rs)' % (block, var, m.group(1) if m else 'missing', hexv)) + except (OSError, ValueError) as e: + err(css_path, 'cannot compare with palettes.rs: %s' % e) # an icon accepted as final on the review page must not change (un-accept it there to work on it again) import json, review_state rp = d + '/review.json' diff --git a/assets/icons/ui/design/tools/preview.py b/assets/icons/ui/design/tools/preview.py index 400fe8df1..82da8936f 100644 --- a/assets/icons/ui/design/tools/preview.py +++ b/assets/icons/ui/design/tools/preview.py @@ -9,7 +9,7 @@ aliases = tomllib.load(open(d + '/aliases.toml', 'rb')).get('alias', {}) def themed(svg, theme, icon, family, size): _, accent = icon_palette.resolve(palette, aliases, icon) return icon_palette.themed(svg, palette, theme, accent, namespace='preview-' + family + '-' + icon + '-' + theme + '-' + str(size)) -h = '' +h = '' for theme in ('light', 'dark'): for fam in sorted(os.listdir(d + '/svg')): h += '

%s - %s

' % (theme, fam, theme) diff --git a/assets/icons/ui/design/tools/review/guide.html b/assets/icons/ui/design/tools/review/guide.html index 062199381..7719b42f4 100644 --- a/assets/icons/ui/design/tools/review/guide.html +++ b/assets/icons/ui/design/tools/review/guide.html @@ -1,6 +1,6 @@ SolidCraft icon style references - +

Icon style references

Return to review. The binding specification is assets/icons/ui/STYLE_GUIDE.md. Read it before editing. These are original SolidCraft bases and finished visual references, shown directly from the current SVG masters.

64-unit grid · 2.55 outlines · 4.25 action strokes · round caps and joins · standard 30° isometric axes · top light, left medium, right dark.

diff --git a/assets/icons/ui/design/tools/review/review.css b/assets/icons/ui/design/tools/review/review.css index f6aa119e9..6c3fe0317 100644 --- a/assets/icons/ui/design/tools/review/review.css +++ b/assets/icons/ui/design/tools/review/review.css @@ -1,5 +1,6 @@ -:root{--bg:#f4f6f9;--fg:#1d2733;--card:#fff;--line:#d5dbe3;--mut:#6b7a8a;--sz:48px} -body.dark{--bg:#1e2530;--fg:#dbe4ee;--card:#262f3c;--line:#3a4657;--mut:#8a9db0} +/* App surfaces (keep in sync with assets/styles/ui/palettes.rs; lint_icons.py checks): --card is the ribbon surface `toolbar` the icons lie on, --bg the page (`panel` in light, `viewport_top` in dark), --line `border`, --fg `text`, --mut `text_dim`. */ +:root{--bg:#fafbfc;--fg:#262a32;--card:#f6f7f9;--line:#d0d4dc;--mut:#6e7480;--sz:48px} +body.dark{--bg:#2e3440;--fg:#dee2e8;--card:#272b34;--line:#3f4552;--mut:#949ba8} body{font:12px system-ui,sans-serif;margin:0;background:var(--bg);color:var(--fg)} header{position:sticky;top:0;background:var(--card);border-bottom:1px solid var(--line);padding:6px 12px;z-index:5;display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center} h1{font-size:14px;margin:0}.sum{color:var(--mut)} diff --git a/assets/icons/ui/source/markers.rs b/assets/icons/ui/source/markers.rs index 1cf8ec843..3560a3135 100644 --- a/assets/icons/ui/source/markers.rs +++ b/assets/icons/ui/source/markers.rs @@ -49,7 +49,7 @@ pub(crate) fn snap(painter: &egui::Painter, c: Pos2, tip: Option, kind: Sn // What it snaps to (hovered), or which component it is (picked): a small label. if let Some(tag) = tag { let t = Tokens::get(); - let font = egui::FontId::proportional(11.5); + let font = egui::FontId::proportional(crate::theme::Tokens::get().font_caption); let g = painter.layout_no_wrap(tag.to_string(), font, t.text); let at = c + vec2(12.0, 10.0); let r = egui::Rect::from_min_size(at, g.size()).expand2(vec2(5.0, 2.0)); diff --git a/assets/icons/ui/source/navigation.rs b/assets/icons/ui/source/navigation.rs index 7192a1814..611c3f558 100644 --- a/assets/icons/ui/source/navigation.rs +++ b/assets/icons/ui/source/navigation.rs @@ -1,6 +1,6 @@ //! Navigation drawing definitions. Camera projection and picking remain in the UI widgets. use crate::theme::Tokens; -use egui::{Align2, Color32, FontId, Pos2, Rect, Shape, Stroke, pos2, vec2}; +use egui::{Color32, FontId, Pos2, Rect, Shape, Stroke, pos2, vec2}; use solidcraft_engine::geom::{Ring, Vec3}; pub(crate) struct Facet { pub(crate) direction: Vec3, @@ -120,7 +120,7 @@ pub(crate) fn paint_cube(painter: &egui::Painter, faces: &[Facet], hovered: Opti } if labels { for face in faces { - face_text(painter, face, t.cube_text, 14.0 * scale); + face_text(painter, face, t.cube_text, t.font_heading * scale); } } } @@ -187,13 +187,14 @@ pub(crate) fn axis_tip(painter: &egui::Painter, c: Pos2, name: &str, d: &Vec3, a } } if positive { - // The letters are heavy: egui's regular face gets a small overstrike for weight. On a - // hovered (white) disc the letter takes the axis colour. + // On a hovered (white) disc the letter takes the axis colour. let letter = if hovered { col } else { t.on_accent }; let label = name.to_uppercase(); - for dx in [-0.45, 0.45] { - painter.text(at + vec2(dx, 0.0), Align2::CENTER_CENTER, &label, FontId::proportional(13.5), letter); - } + let galley = painter.layout_no_wrap(label, crate::fonts::bold(crate::theme::Tokens::get().font_compass), letter); + let origin = at - galley.size() / 2.0; + let ppp = painter.ctx().pixels_per_point().max(0.5); + let origin = pos2((origin.x * ppp).round() / ppp, (origin.y * ppp).round() / ppp); + painter.galley(origin, galley, letter); } if !positive { painter.circle_stroke( diff --git a/assets/icons/ui/source/pointer.rs b/assets/icons/ui/source/pointer.rs index b637f7534..dd16e2d4d 100644 --- a/assets/icons/ui/source/pointer.rs +++ b/assets/icons/ui/source/pointer.rs @@ -11,7 +11,7 @@ pub(crate) fn paint(painter: &egui::Painter, p: Pos2) { [(0.0, 0.0), (0.0, 17.0), (4.5, 13.0), (7.5, 20.0), (10.5, 18.8), (7.5, 12.0), (13.0, 12.0)].iter().map(|(x, y)| p + vec2(*x, *y)).collect(); painter.add(Shape::convex_polygon(pts.clone(), ic.agent, Stroke::NONE)); painter.add(Shape::closed_line(pts, Stroke::new(1.5, ic.highlight))); - let label = painter.layout_no_wrap("Agent".into(), FontId::proportional(11.0), ic.highlight); + let label = painter.layout_no_wrap("Agent".into(), FontId::proportional(crate::theme::Tokens::get().font_small), ic.highlight); let r = egui::Rect::from_min_size(p + vec2(15.0, 18.0), label.size() + vec2(10.0, 4.0)); painter.rect_filled(r, 4.0, ic.agent); painter.galley(r.min + vec2(5.0, 2.0), label, ic.highlight); diff --git a/assets/locales/cs.json b/assets/locales/cs.json index a90c4b2f2..b7e183ada 100644 --- a/assets/locales/cs.json +++ b/assets/locales/cs.json @@ -816,8 +816,18 @@ "settings.reset_title": "Nastavení byla změněna", "settings.supersampling_note": "Vykresluje pohled ve vyšším rozlišení a poté jej zmenšuje: hladší hrany, čáry a mřížka na obrazovkách pod 4K. Stojí výkon GPU: asi 2,25× více pixelů při 1,5× a 4× při 2×.", "sketch.degrees_of_freedom": "Stupně volnosti: {count}", + "sketch.dof_left": "Zbývající stupně volnosti: {count}", + "sketch.dof_left_one": "Zbývá {count} stupeň volnosti", "sketch.draw_curves": "Kreslit jako {linetype}", "sketch.make_selection": "Převést výběr na {linetype}", + "sketch_panel.attached": "Připojeno k {body} / {path}", + "sketch_panel.author": "Umístění autora: {path}", + "sketch_panel.dimension_hint": "Zadejte hodnotu nebo výraz a poté stiskněte OK.", + "sketch_panel.move_hint": "Zadejte vzdálenosti a úhel a poté stiskněte OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Připojeno k rovinné ploše plechového tělesa; při změně plechu sleduje tento panel.", + "sketch_panel.text_hint": "Upravte text a jeho umístění a poté stiskněte OK.", + "sketch_panel.use_plane": "Použít rovinu {plane}", "sketch_text.align_center": "Na střed", "sketch_text.align_left": "Vlevo", "sketch_text.align_right": "Vpravo", @@ -1073,6 +1083,7 @@ "ui.combine": "Kombinovat", "ui.coming_later": "připravujeme", "ui.command_done": "{command} hotovo", + "ui.command_palette_hint": "Zadejte příkaz, např. {example} — nebo stiskněte S pro hledání", "ui.concentric": "Soustřednost", "ui.configurations": "Konfigurace", "ui.conic_curve": "Kuželosečka", @@ -1328,8 +1339,11 @@ "ui.orbit_around": "Otáčet kolem", "ui.orientation": "Orientace", "ui.origin": "Počátek", + "ui.palette_construction_mode": "Konstrukční režim (X)", + "ui.palette_more": "Další", "ui.palette_points": "Body", "ui.palette_profile": "Profil", + "ui.palette_sketch_options": "Možnosti náčrtu", "ui.pan": "Posun", "ui.pan_zoom_orbit": "Posun, přiblížení, otáčení", "ui.parallel": "Rovnoběžnost", diff --git a/assets/locales/de.json b/assets/locales/de.json index 0a5d32532..a9b92f76f 100644 --- a/assets/locales/de.json +++ b/assets/locales/de.json @@ -623,8 +623,18 @@ "settings.reset_title": "Einstellungen wurden geändert", "settings.supersampling_note": "Zeichnet die Ansicht in höherer Auflösung und rechnet sie herunter: glattere Kanten, Linien und Raster auf Bildschirmen unter 4K. Kostet GPU-Zeit: etwa 2,25-mal so viele Pixel bei 1,5× und 4-mal bei 2×.", "sketch.degrees_of_freedom": "{count} Freiheitsgrade", + "sketch.dof_left": "{count} Freiheitsgrade übrig", + "sketch.dof_left_one": "{count} Freiheitsgrad übrig", "sketch.draw_curves": "Als {linetype} zeichnen", "sketch.make_selection": "Auswahl als {linetype} markieren", + "sketch_panel.attached": "Angehängt an {body} / {path}", + "sketch_panel.author": "Autorenplatzierung: {path}", + "sketch_panel.dimension_hint": "Einen Wert oder Ausdruck eingeben, dann OK drücken.", + "sketch_panel.move_hint": "Abstände und einen Winkel eingeben, dann OK drücken.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "An eine ebene Fläche eines Blechkörpers angehängt; folgt diesem Bereich bei Änderungen am Blech.", + "sketch_panel.text_hint": "Text und Platzierung bearbeiten, dann OK drücken.", + "sketch_panel.use_plane": "Ebene {plane} verwenden", "sketch_text.align_center": "Mitte", "sketch_text.align_left": "Links", "sketch_text.align_right": "Rechts", @@ -861,6 +871,7 @@ "ui.combine": "Kombinieren", "ui.coming_later": "bald verfügbar", "ui.command_done": "{command} fertig", + "ui.command_palette_hint": "Befehl eingeben, z. B. {example} — oder S drücken, um zu suchen", "ui.concentric": "Konzentrisch", "ui.configurations": "Konfigurationen", "ui.conic_curve": "Kegelschnitt", @@ -1115,8 +1126,11 @@ "ui.orbit_around": "Umkreisen um", "ui.orientation": "Ausrichtung", "ui.origin": "Ursprung", + "ui.palette_construction_mode": "Konstruktionsmodus (X)", + "ui.palette_more": "Mehr", "ui.palette_points": "Punkte", "ui.palette_profile": "Profil", + "ui.palette_sketch_options": "Skizzenoptionen", "ui.pan": "Verschieben", "ui.pan_zoom_orbit": "Verschieben, zoomen, umkreisen", "ui.parallel": "Parallel", diff --git a/assets/locales/en.json b/assets/locales/en.json index 932f107ed..3adf554da 100644 --- a/assets/locales/en.json +++ b/assets/locales/en.json @@ -905,10 +905,20 @@ "settings.reset_title": "Settings were changed", "settings.supersampling_note": "Draws the view at a higher resolution and filters it down: smoother edges, lines and grid on screens below 4K. It costs GPU time: about 2.25× the pixels at 1.5× and 4× at 2×.", "sketch.degrees_of_freedom": "{count} degrees of freedom", + "sketch.dof_left": "{count} degrees of freedom left", + "sketch.dof_left_one": "{count} degree of freedom left", "sketch.draw_curves": "Draw as {linetype}", "sketch.make_selection": "Convert the selection to {linetype}", "sketch.open_ends": "Open {count}", "sketch.untied_ends": "Untied {count}", + "sketch_panel.attached": "Attached to {body} / {path}", + "sketch_panel.author": "Author placement: {path}", + "sketch_panel.dimension_hint": "Enter a value or expression, then press OK.", + "sketch_panel.move_hint": "Enter distances and an angle, then press OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Attached to a flat face of a sheet metal body; it follows that panel when the sheet changes.", + "sketch_panel.text_hint": "Edit the text and its placement, then press OK.", + "sketch_panel.use_plane": "Use {plane} plane", "sketch_text.align_center": "Center", "sketch_text.align_left": "Left", "sketch_text.align_right": "Right", @@ -1205,6 +1215,7 @@ "ui.combine": "Combine", "ui.coming_later": "coming later", "ui.command_done": "{command} done", + "ui.command_palette_hint": "Type a command, e.g. {example} — or press S to search", "ui.concentric": "Concentric", "ui.configurations": "Configurations", "ui.conic_curve": "Conic Curve", @@ -1475,8 +1486,11 @@ "ui.orbit_around": "Orbit around", "ui.orientation": "Orientation", "ui.origin": "Origin", + "ui.palette_construction_mode": "Construction mode (X)", + "ui.palette_more": "More", "ui.palette_points": "Points", "ui.palette_profile": "Profile", + "ui.palette_sketch_options": "Sketch options", "ui.pan": "Pan", "ui.pan_zoom_orbit": "Pan, zoom, orbit", "ui.parallel": "Parallel", diff --git a/assets/locales/es.json b/assets/locales/es.json index a98c609dc..1d815a4db 100644 --- a/assets/locales/es.json +++ b/assets/locales/es.json @@ -831,8 +831,18 @@ "settings.reset_title": "Se han cambiado los ajustes", "settings.supersampling_note": "Dibuja la vista a mayor resolución y después la reduce: bordes, líneas y cuadrícula más suaves en pantallas inferiores a 4K. Consume recursos de GPU: unos 2,25× píxeles a 1,5× y 4× a 2×.", "sketch.degrees_of_freedom": "{count} grados de libertad", + "sketch.dof_left": "Quedan {count} grados de libertad", + "sketch.dof_left_one": "Queda {count} grado de libertad", "sketch.draw_curves": "Dibujar como {linetype}", "sketch.make_selection": "Convertir la selección a {linetype}", + "sketch_panel.attached": "Vinculado a {body} / {path}", + "sketch_panel.author": "Ubicación de autoría: {path}", + "sketch_panel.dimension_hint": "Introduzca un valor o una expresión y pulse Aceptar.", + "sketch_panel.move_hint": "Introduzca las distancias y un ángulo y pulse Aceptar.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Vinculado a una cara plana de un cuerpo de chapa; sigue ese panel cuando cambia la chapa.", + "sketch_panel.text_hint": "Edite el texto y su posición y pulse Aceptar.", + "sketch_panel.use_plane": "Usar plano {plane}", "sketch_text.align_center": "Centrar", "sketch_text.align_left": "Alinear a la izquierda", "sketch_text.align_right": "Alinear a la derecha", @@ -1092,6 +1102,7 @@ "ui.combine": "Combinar", "ui.coming_later": "próximamente", "ui.command_done": "{command} completado", + "ui.command_palette_hint": "Escribe un comando, p. ej., {example}, o pulsa S para buscar", "ui.concentric": "Concéntrico", "ui.configurations": "Configuraciones", "ui.conic_curve": "Curva cónica", @@ -1352,8 +1363,11 @@ "ui.orbit_around": "Orbitar alrededor de", "ui.orientation": "Orientación", "ui.origin": "Origen", + "ui.palette_construction_mode": "Modo de construcción (X)", + "ui.palette_more": "Más", "ui.palette_points": "Puntos", "ui.palette_profile": "Perfil", + "ui.palette_sketch_options": "Opciones de croquis", "ui.pan": "Desplazar", "ui.pan_zoom_orbit": "Desplazar, zoom y orbitar", "ui.parallel": "Paralelo", diff --git a/assets/locales/fr.json b/assets/locales/fr.json index 2c748ac63..93ccd9f1b 100644 --- a/assets/locales/fr.json +++ b/assets/locales/fr.json @@ -845,10 +845,20 @@ "settings.reset_title": "Des réglages ont été modifiés", "settings.supersampling_note": "Dessine la vue à une résolution plus élevée puis la réduit : arêtes, lignes et grille plus lisses sur les écrans de définition inférieure à la 4K. Cela coûte du temps GPU : environ 2,25× plus de pixels à 1,5× et 4× plus à 2×.", "sketch.degrees_of_freedom": "{count} degrés de liberté", + "sketch.dof_left": "{count} degrés de liberté restants", + "sketch.dof_left_one": "{count} degré de liberté restant", "sketch.draw_curves": "Dessiner en {linetype}", "sketch.make_selection": "Convertir la sélection en {linetype}", "sketch.open_ends": "{count} ouvertes", "sketch.untied_ends": "{count} sans coïncidence", + "sketch_panel.attached": "Attaché à {body} / {path}", + "sketch_panel.author": "Placement d’origine : {path}", + "sketch_panel.dimension_hint": "Saisissez une valeur ou une expression, puis appuyez sur OK.", + "sketch_panel.move_hint": "Saisissez les distances et un angle, puis appuyez sur OK.", + "sketch_panel.redefine_title": "{command} : {name}", + "sketch_panel.sheet_attachment": "Attaché à une face plane d’un corps de tôlerie ; suit ce panneau lorsque la tôle change.", + "sketch_panel.text_hint": "Modifiez le texte et son placement, puis appuyez sur OK.", + "sketch_panel.use_plane": "Utiliser le plan {plane}", "sketch_text.align_center": "Centre", "sketch_text.align_left": "Gauche", "sketch_text.align_right": "Droite", @@ -1143,6 +1153,7 @@ "ui.combine": "Combiner", "ui.coming_later": "bientôt disponible", "ui.command_done": "{command} terminé", + "ui.command_palette_hint": "Tapez une commande, ex. {example} — ou S pour chercher", "ui.concentric": "Concentricité", "ui.configurations": "Configurations", "ui.conic_curve": "Courbe conique", @@ -1411,8 +1422,11 @@ "ui.orbit_around": "Orbite autour de", "ui.orientation": "Orientation", "ui.origin": "Origine", + "ui.palette_construction_mode": "Mode construction (X)", + "ui.palette_more": "Plus", "ui.palette_points": "Points", "ui.palette_profile": "Profil", + "ui.palette_sketch_options": "Options d’esquisse", "ui.pan": "Panoramique", "ui.pan_zoom_orbit": "Panoramique, zoom, orbite", "ui.parallel": "Parallélisme", diff --git a/assets/locales/gl.json b/assets/locales/gl.json index 1f5e26f3b..5d4efc3bc 100644 --- a/assets/locales/gl.json +++ b/assets/locales/gl.json @@ -807,8 +807,18 @@ "settings.reset_title": "Cambiáronse os axustes", "settings.supersampling_note": "Debuxa a vista a unha resolución maior e fíltraa cara abaixo: arestas, liñas e grella máis suaves en pantallas por debaixo de 4K. Consome tempo de GPU: uns 2,25× píxeles a 1,5× e 4× a 2×.", "sketch.degrees_of_freedom": "{count} graos de liberdade", + "sketch.dof_left": "Quedan {count} graos de liberdade", + "sketch.dof_left_one": "Queda {count} grao de liberdade", "sketch.draw_curves": "Debuxar como {linetype}", "sketch.make_selection": "Converter a selección en {linetype}", + "sketch_panel.attached": "Ligado a {body} / {path}", + "sketch_panel.author": "Localización de autoría: {path}", + "sketch_panel.dimension_hint": "Introduza un valor ou unha expresión e prema Aceptar.", + "sketch_panel.move_hint": "Introduza as distancias e un ángulo e prema Aceptar.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Ligado a unha cara plana dun corpo de chapa; segue ese panel cando cambia a chapa.", + "sketch_panel.text_hint": "Edite o texto e a súa posición e prema Aceptar.", + "sketch_panel.use_plane": "Usar plano {plane}", "sketch_text.align_center": "Centro", "sketch_text.align_left": "Esquerda", "sketch_text.align_right": "Dereita", @@ -1064,6 +1074,7 @@ "ui.combine": "Combinar", "ui.coming_later": "máis adiante", "ui.command_done": "{command} feito", + "ui.command_palette_hint": "Escribe unha orde, p. ex. {example} — ou preme S para buscar", "ui.concentric": "Concéntrica", "ui.configurations": "Configuracións", "ui.conic_curve": "Curva cónica", @@ -1319,8 +1330,11 @@ "ui.orbit_around": "Orbitar arredor de", "ui.orientation": "Orientación", "ui.origin": "Orixe", + "ui.palette_construction_mode": "Modo de construción (X)", + "ui.palette_more": "Máis", "ui.palette_points": "Puntos", "ui.palette_profile": "Perfil", + "ui.palette_sketch_options": "Opcións do esbozo", "ui.pan": "Desprazar", "ui.pan_zoom_orbit": "Desprazar, zoom, orbitar", "ui.parallel": "Paralela", diff --git a/assets/locales/it.json b/assets/locales/it.json index 62cbd03b1..3bbdd118a 100644 --- a/assets/locales/it.json +++ b/assets/locales/it.json @@ -168,7 +168,6 @@ "No matching appearances": "Nessun aspetto corrispondente", "No visible bodies to export.": "Nessun corpo visibile da esportare.", "None": "Nessuno", - "Normal to sketch": "Normale allo schizzo", "Not available yet": "Non ancora disponibile", "Notch": "Intaglio", "Opacity": "Opacità", @@ -812,10 +811,20 @@ "settings.reset_title": "Le impostazioni sono state modificate", "settings.supersampling_note": "Disegna la vista a una risoluzione maggiore e la riduce tramite filtro: spigoli, linee e griglia più uniformi sugli schermi sotto il 4K. Richiede tempo GPU: circa 2.25× i pixel a 1.5× e 4× a 2×.", "sketch.degrees_of_freedom": "{count} gradi di libertà", + "sketch.dof_left": "{count} gradi di libertà rimanenti", + "sketch.dof_left_one": "{count} grado di libertà rimanente", "sketch.draw_curves": "Disegna come {linetype}", "sketch.make_selection": "Converti la selezione in {linetype}", "sketch.open_ends": "Aperte {count}", "sketch.untied_ends": "Non vincolate {count}", + "sketch_panel.attached": "Collegato a {body} / {path}", + "sketch_panel.author": "Posizionamento originale: {path}", + "sketch_panel.dimension_hint": "Inserisci un valore o un’espressione, poi premi OK.", + "sketch_panel.move_hint": "Inserisci distanze e angolo, poi premi OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Collegato a una faccia piana di un corpo in lamiera; segue il pannello quando la lamiera cambia.", + "sketch_panel.text_hint": "Modifica il testo e la sua posizione, poi premi OK.", + "sketch_panel.use_plane": "Usa il piano {plane}", "sketch_text.align_center": "Centro", "sketch_text.align_left": "Sinistra", "sketch_text.align_right": "Destra", @@ -1075,6 +1084,7 @@ "ui.combine": "Combina", "ui.coming_later": "in arrivo", "ui.command_done": "{command} completato", + "ui.command_palette_hint": "Digita un comando, ad es. {example} — oppure premi S per cercare", "ui.concentric": "Concentrico", "ui.configurations": "Configurazioni", "ui.conic_curve": "Curva conica", @@ -1336,8 +1346,11 @@ "ui.orbit_around": "Orbita attorno a", "ui.orientation": "Orientamento", "ui.origin": "Origine", + "ui.palette_construction_mode": "Modalità costruzione (X)", + "ui.palette_more": "Altro", "ui.palette_points": "Punti", "ui.palette_profile": "Profilo", + "ui.palette_sketch_options": "Opzioni schizzo", "ui.pan": "Panoramica", "ui.pan_zoom_orbit": "Panoramica, zoom, orbita", "ui.parallel": "Parallelo", diff --git a/assets/locales/ja.json b/assets/locales/ja.json index feec1edef..0c8a593d6 100644 --- a/assets/locales/ja.json +++ b/assets/locales/ja.json @@ -905,10 +905,20 @@ "settings.reset_title": "設定が変更されました", "settings.supersampling_note": "ビューを高い解像度で描画してから縮小します。4K 未満の画面でエッジ、線、グリッドが滑らかになります。GPU の負荷が増えます(1.5× で約 2.25 倍、2× で 4 倍のピクセル)。", "sketch.degrees_of_freedom": "自由度 {count}", + "sketch.dof_left": "残り自由度 {count}", + "sketch.dof_left_one": "残り自由度 {count}", "sketch.draw_curves": "{linetype}として描く", "sketch.make_selection": "選択を{linetype}にする", "sketch.open_ends": "開放 {count}", "sketch.untied_ends": "未拘束 {count}", + "sketch_panel.attached": "接続先: {body} / {path}", + "sketch_panel.author": "作成時の配置: {path}", + "sketch_panel.dimension_hint": "値または式を入力し、OK を押してください。", + "sketch_panel.move_hint": "距離と角度を入力し、OK を押してください。", + "sketch_panel.redefine_title": "{command}:{name}", + "sketch_panel.sheet_attachment": "板金ボディの平面に接続されています。板金が変更されると、そのパネルに追従します。", + "sketch_panel.text_hint": "テキストと配置を編集し、OK を押してください。", + "sketch_panel.use_plane": "{plane} 平面を使用", "sketch_text.align_center": "中央", "sketch_text.align_left": "左", "sketch_text.align_right": "右", @@ -1205,6 +1215,7 @@ "ui.combine": "結合", "ui.coming_later": "準備中", "ui.command_done": "{command} 完了", + "ui.command_palette_hint": "コマンドを入力(例: {example})— または S キーで検索", "ui.concentric": "同心", "ui.configurations": "構成", "ui.conic_curve": "円錐曲線", @@ -1475,8 +1486,11 @@ "ui.orbit_around": "回転中心", "ui.orientation": "向き", "ui.origin": "原点", + "ui.palette_construction_mode": "補助線モード (X)", + "ui.palette_more": "その他", "ui.palette_points": "点", "ui.palette_profile": "プロファイル", + "ui.palette_sketch_options": "スケッチオプション", "ui.pan": "パン", "ui.pan_zoom_orbit": "パン、ズーム、オービット", "ui.parallel": "平行", diff --git a/assets/locales/ko.json b/assets/locales/ko.json index a4f225dc3..5b008cc2e 100644 --- a/assets/locales/ko.json +++ b/assets/locales/ko.json @@ -623,8 +623,18 @@ "settings.reset_title": "설정이 변경되었습니다", "settings.supersampling_note": "뷰를 더 높은 해상도로 그린 뒤 축소합니다. 4K 미만 화면에서 모서리, 선, 그리드가 더 매끄러워집니다. GPU 시간이 듭니다: 1.5×에서 약 2.25배, 2×에서 4배의 픽셀.", "sketch.degrees_of_freedom": "자유도 {count}개", + "sketch.dof_left": "남은 자유도 {count}개", + "sketch.dof_left_one": "남은 자유도 {count}개", "sketch.draw_curves": "{linetype}(으)로 그리기", "sketch.make_selection": "선택 항목을 {linetype}(으)로 변경", + "sketch_panel.attached": "부착 대상: {body} / {path}", + "sketch_panel.author": "작성 배치: {path}", + "sketch_panel.dimension_hint": "값이나 수식을 입력한 다음 확인을 누르세요.", + "sketch_panel.move_hint": "거리와 각도를 입력한 다음 확인을 누르세요.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "판금 바디의 평평한 면에 부착되어 있으며 판금이 변경되면 해당 패널을 따릅니다.", + "sketch_panel.text_hint": "텍스트와 배치를 편집한 다음 확인을 누르세요.", + "sketch_panel.use_plane": "{plane} 평면 사용", "sketch_text.align_center": "가운데", "sketch_text.align_left": "왼쪽", "sketch_text.align_right": "오른쪽", @@ -861,6 +871,7 @@ "ui.combine": "결합", "ui.coming_later": "추후 지원 예정", "ui.command_done": "{command} 완료", + "ui.command_palette_hint": "명령 입력(예: {example}) — 또는 S 키를 눌러 검색", "ui.concentric": "동심", "ui.configurations": "구성", "ui.conic_curve": "원뿔 곡선", @@ -1115,8 +1126,11 @@ "ui.orbit_around": "궤도 회전 기준", "ui.orientation": "배향", "ui.origin": "원점", + "ui.palette_construction_mode": "보조선 모드 (X)", + "ui.palette_more": "더 보기", "ui.palette_points": "점", "ui.palette_profile": "프로파일", + "ui.palette_sketch_options": "스케치 옵션", "ui.pan": "이동", "ui.pan_zoom_orbit": "이동, 확대/축소, 궤도 회전", "ui.parallel": "평행", diff --git a/assets/locales/ms.json b/assets/locales/ms.json index 1767deb87..510fea6c2 100644 --- a/assets/locales/ms.json +++ b/assets/locales/ms.json @@ -1060,6 +1060,7 @@ "ui.combine": "Gabung", "ui.coming_later": "akan datang", "ui.command_done": "{command} selesai", + "ui.command_palette_hint": "Taip arahan, cth. {example} — atau tekan S untuk mencari", "ui.concentric": "Sepusat", "ui.configurations": "Konfigurasi", "ui.conic_curve": "Lengkung Kon", diff --git a/assets/locales/pl.json b/assets/locales/pl.json index a42500712..3b8c02fc0 100644 --- a/assets/locales/pl.json +++ b/assets/locales/pl.json @@ -798,10 +798,20 @@ "settings.reset_title": "Zmieniono ustawienia", "settings.supersampling_note": "Rysuje widok w wyższej rozdzielczości i go zmniejsza: gładsze krawędzie, linie i siatka na ekranach poniżej 4K. Kosztuje czas GPU: ok. 2,25× więcej pikseli przy 1,5× i 4× przy 2×.", "sketch.degrees_of_freedom": "Stopnie swobody: {count}", + "sketch.dof_left": "Pozostałe stopnie swobody: {count}", + "sketch.dof_left_one": "Pozostał {count} stopień swobody", "sketch.draw_curves": "Rysuj jako {linetype}", "sketch.make_selection": "Zamień zaznaczenie na {linetype}", "sketch.open_ends": "Otwarte: {count}", "sketch.untied_ends": "Niezwiązane: {count}", + "sketch_panel.attached": "Dołączony do {body} / {path}", + "sketch_panel.author": "Pierwotne położenie: {path}", + "sketch_panel.dimension_hint": "Wprowadź wartość lub wyrażenie, a następnie naciśnij OK.", + "sketch_panel.move_hint": "Wprowadź odległości i kąt, a następnie naciśnij OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Dołączony do płaskiej ściany bryły blaszanej; podąża za tym panelem przy zmianach blachy.", + "sketch_panel.text_hint": "Edytuj tekst i jego położenie, a następnie naciśnij OK.", + "sketch_panel.use_plane": "Użyj płaszczyzny {plane}", "sketch_text.align_center": "Do środka", "sketch_text.align_left": "Do lewej", "sketch_text.align_right": "Do prawej", @@ -1063,6 +1073,7 @@ "ui.combine": "Kombinacja", "ui.coming_later": "wkrótce", "ui.command_done": "Wykonano: {command}", + "ui.command_palette_hint": "Wpisz polecenie, np. {example} — lub naciśnij S, aby wyszukać", "ui.concentric": "Współśrodkowość", "ui.configurations": "Konfiguracje", "ui.conic_curve": "Krzywa stożkowa", @@ -1324,8 +1335,11 @@ "ui.orbit_around": "Obracaj wokół", "ui.orientation": "Orientacja", "ui.origin": "Początek układu", + "ui.palette_construction_mode": "Tryb konstrukcyjny (X)", + "ui.palette_more": "Więcej", "ui.palette_points": "Punkty", "ui.palette_profile": "Profil", + "ui.palette_sketch_options": "Opcje szkicu", "ui.pan": "Przesuwanie", "ui.pan_zoom_orbit": "Przesuwanie, powiększanie, obracanie", "ui.parallel": "Równoległość", diff --git a/assets/locales/pt-BR.json b/assets/locales/pt-BR.json index 4dae07958..5ae9a0280 100644 --- a/assets/locales/pt-BR.json +++ b/assets/locales/pt-BR.json @@ -790,8 +790,18 @@ "settings.reset_title": "As configurações foram alteradas", "settings.supersampling_note": "Desenha a vista em resolução maior e a filtra para baixo: arestas, linhas e grade mais suaves em telas abaixo de 4K. Custa tempo de GPU: cerca de 2,25× os pixels em 1,5× e 4× em 2×.", "sketch.degrees_of_freedom": "{count} graus de liberdade", + "sketch.dof_left": "{count} graus de liberdade restantes", + "sketch.dof_left_one": "{count} grau de liberdade restante", "sketch.draw_curves": "Desenhar como {linetype}", "sketch.make_selection": "Converter a seleção em {linetype}", + "sketch_panel.attached": "Anexado a {body} / {path}", + "sketch_panel.author": "Posicionamento de autoria: {path}", + "sketch_panel.dimension_hint": "Insira um valor ou uma expressão e pressione OK.", + "sketch_panel.move_hint": "Insira as distâncias e um ângulo e pressione OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Anexado a uma face plana de um corpo de chapa; acompanha esse painel quando a chapa muda.", + "sketch_panel.text_hint": "Edite o texto e seu posicionamento e pressione OK.", + "sketch_panel.use_plane": "Usar plano {plane}", "sketch_text.align_center": "Centro", "sketch_text.align_left": "Esquerda", "sketch_text.align_right": "Direita", @@ -1047,6 +1057,7 @@ "ui.combine": "Combinar", "ui.coming_later": "em breve", "ui.command_done": "{command} concluído", + "ui.command_palette_hint": "Digite um comando, p. ex. {example} — ou pressione S para pesquisar", "ui.concentric": "Concêntrico", "ui.configurations": "Configurações", "ui.conic_curve": "Curva cônica", @@ -1302,8 +1313,11 @@ "ui.orbit_around": "Orbitar em torno de", "ui.orientation": "Orientação", "ui.origin": "Origem", + "ui.palette_construction_mode": "Modo de construção (X)", + "ui.palette_more": "Mais", "ui.palette_points": "Pontos", "ui.palette_profile": "Perfil", + "ui.palette_sketch_options": "Opções de esboço", "ui.pan": "Deslocar", "ui.pan_zoom_orbit": "Deslocar, zoom, orbitar", "ui.parallel": "Paralelo", diff --git a/assets/locales/ru.json b/assets/locales/ru.json index 9e94cd002..3a7d82f0f 100644 --- a/assets/locales/ru.json +++ b/assets/locales/ru.json @@ -752,8 +752,18 @@ "settings.reset_intro": "Эти настройки не работают на этом компьютере и могли бы помешать запуску SolidCraft, поэтому они были изменены:", "settings.reset_title": "Настройки были изменены", "sketch.degrees_of_freedom": "Степеней свободы: {count}", + "sketch.dof_left": "Осталось степеней свободы: {count}", + "sketch.dof_left_one": "Осталась {count} степень свободы", "sketch.draw_curves": "Рисовать как {linetype}", "sketch.make_selection": "Преобразовать выделение в {linetype}", + "sketch_panel.attached": "Привязано к {body} / {path}", + "sketch_panel.author": "Исходное размещение: {path}", + "sketch_panel.dimension_hint": "Введите значение или выражение, затем нажмите OK.", + "sketch_panel.move_hint": "Введите расстояния и угол, затем нажмите OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Привязано к плоской грани листового тела; следует за этой панелью при изменении листа.", + "sketch_panel.text_hint": "Измените текст и его размещение, затем нажмите OK.", + "sketch_panel.use_plane": "Использовать плоскость {plane}", "sketch_text.align_center": "По центру", "sketch_text.align_left": "По левому краю", "sketch_text.align_right": "По правому краю", @@ -856,6 +866,7 @@ "ui.combine": "Объединение", "ui.coming_later": "появится позже", "ui.command_done": "{command} — готово", + "ui.command_palette_hint": "Введите команду, напр. {example} — или нажмите S для поиска", "ui.concentric": "Концентричность", "ui.configurations": "Конфигурации", "ui.conic_curve": "Коническая кривая", @@ -1110,8 +1121,11 @@ "ui.orbit_around": "Вращать вокруг", "ui.orientation": "Ориентация", "ui.origin": "Начало координат", + "ui.palette_construction_mode": "Вспомогательный режим (X)", + "ui.palette_more": "Ещё", "ui.palette_points": "Точки", "ui.palette_profile": "Профиль", + "ui.palette_sketch_options": "Параметры эскиза", "ui.pan": "Панорамирование", "ui.pan_zoom_orbit": "Панорама, масштаб, орбита", "ui.parallel": "Параллельность", diff --git a/assets/locales/tr.json b/assets/locales/tr.json index 2747eef9e..84aba852c 100644 --- a/assets/locales/tr.json +++ b/assets/locales/tr.json @@ -755,8 +755,18 @@ "settings.reset_title": "Ayarlar değiştirildi", "settings.supersampling_note": "Görünümü daha yüksek çözünürlükte çizer ve küçültür: 4K altındaki ekranlarda kenarlar, çizgiler ve ızgaralar daha pürüzsüz görünür. GPU süresi gerektirir: 1,5× ayarında yaklaşık 2,25 kat, 2× ayarında 4 kat daha fazla piksel işlenir.", "sketch.degrees_of_freedom": "{count} serbestlik derecesi", + "sketch.dof_left": "Kalan serbestlik derecesi: {count}", + "sketch.dof_left_one": "Kalan serbestlik derecesi: {count}", "sketch.draw_curves": "{linetype} olarak çiz", "sketch.make_selection": "Seçimi {linetype} olarak işaretle", + "sketch_panel.attached": "Bağlı olduğu: {body} / {path}", + "sketch_panel.author": "Yazar yerleşimi: {path}", + "sketch_panel.dimension_hint": "Bir değer veya ifade girip Tamam’a basın.", + "sketch_panel.move_hint": "Uzaklıkları ve bir açı girip Tamam’a basın.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Sac gövdenin düz bir yüzüne bağlıdır; sac değiştiğinde bu paneli izler.", + "sketch_panel.text_hint": "Metni ve yerleşimini düzenleyip Tamam’a basın.", + "sketch_panel.use_plane": "{plane} düzlemini kullan", "sketch_text.align_center": "Orta", "sketch_text.align_left": "Sol", "sketch_text.align_right": "Sağ", @@ -994,6 +1004,7 @@ "ui.combine": "Birleştir", "ui.coming_later": "yakında", "ui.command_done": "{command} tamamlandı", + "ui.command_palette_hint": "Bir komut yazın (ör. {example}) — veya aramak için S tuşuna basın", "ui.concentric": "Eş merkezli", "ui.configurations": "Konfigürasyonlar", "ui.conic_curve": "Konik eğri", @@ -1247,8 +1258,11 @@ "ui.orbit_around": "Etrafında döndür", "ui.orientation": "Yönlendirme", "ui.origin": "Orijin", + "ui.palette_construction_mode": "Yardımcı çizim modu (X)", + "ui.palette_more": "Diğer", "ui.palette_points": "Noktalar", "ui.palette_profile": "Profil", + "ui.palette_sketch_options": "Eskiz seçenekleri", "ui.pan": "Kaydır", "ui.pan_zoom_orbit": "Kaydır, yakınlaştır, döndür", "ui.parallel": "Paralel", diff --git a/assets/locales/uk.json b/assets/locales/uk.json index 6d7571acd..4b76a4302 100644 --- a/assets/locales/uk.json +++ b/assets/locales/uk.json @@ -845,10 +845,20 @@ "settings.reset_title": "Налаштування було змінено", "settings.supersampling_note": "Малює вид у вищій роздільності й потім зменшує його: плавніші ребра, лінії та сітка на екранах до 4K. Це коштує часу GPU: приблизно 2,25× пікселів за 1,5× і 4× за 2×.", "sketch.degrees_of_freedom": "{count} ступенів вільності", + "sketch.dof_left": "Залишилося ступенів свободи: {count}", + "sketch.dof_left_one": "Залишився {count} ступінь свободи", "sketch.draw_curves": "Малювати як {linetype}", "sketch.make_selection": "Перетворити виділене на {linetype}", "sketch.open_ends": "Відкритих: {count}", "sketch.untied_ends": "Незв'язаних: {count}", + "sketch_panel.attached": "Прив’язано до {body} / {path}", + "sketch_panel.author": "Початкове розміщення: {path}", + "sketch_panel.dimension_hint": "Введіть значення або вираз, потім натисніть OK.", + "sketch_panel.move_hint": "Введіть відстані та кут, потім натисніть OK.", + "sketch_panel.redefine_title": "{command}: {name}", + "sketch_panel.sheet_attachment": "Прив’язано до плоскої грані листового тіла; слідує за цією панеллю під час зміни листа.", + "sketch_panel.text_hint": "Змініть текст і його розміщення, потім натисніть OK.", + "sketch_panel.use_plane": "Використати площину {plane}", "sketch_text.align_center": "По центру", "sketch_text.align_left": "Ліворуч", "sketch_text.align_right": "Праворуч", @@ -1143,6 +1153,7 @@ "ui.combine": "Об'єднати", "ui.coming_later": "з'явиться пізніше", "ui.command_done": "{command} виконано", + "ui.command_palette_hint": "Введіть команду, напр. {example} — або натисніть S для пошуку", "ui.concentric": "Концентричність", "ui.configurations": "Конфігурації", "ui.conic_curve": "Конічна крива", @@ -1410,8 +1421,11 @@ "ui.orbit_around": "Обертати навколо", "ui.orientation": "Орієнтація", "ui.origin": "Початок координат", + "ui.palette_construction_mode": "Допоміжний режим (X)", + "ui.palette_more": "Більше", "ui.palette_points": "Точки", "ui.palette_profile": "Профіль", + "ui.palette_sketch_options": "Параметри ескізу", "ui.pan": "Панорамувати", "ui.pan_zoom_orbit": "Панорамування, масштаб, обертання", "ui.parallel": "Паралельність", diff --git a/assets/locales/zh.json b/assets/locales/zh.json index 7033e195a..c6d893c26 100644 --- a/assets/locales/zh.json +++ b/assets/locales/zh.json @@ -905,10 +905,20 @@ "settings.reset_title": "设置已更改", "settings.supersampling_note": "以更高分辨率绘制视图再缩小:在低于 4K 的屏幕上边、线和网格更平滑。会消耗 GPU 时间:1.5× 时约 2.25 倍像素,2× 时 4 倍。", "sketch.degrees_of_freedom": "{count} 个自由度", + "sketch.dof_left": "剩余 {count} 个自由度", + "sketch.dof_left_one": "剩余 {count} 个自由度", "sketch.draw_curves": "绘制为 {linetype}", "sketch.make_selection": "将选择转换为 {linetype}", "sketch.open_ends": "开放 {count}", "sketch.untied_ends": "未约束 {count}", + "sketch_panel.attached": "附着到 {body} / {path}", + "sketch_panel.author": "创建时的放置:{path}", + "sketch_panel.dimension_hint": "输入数值或表达式,然后按“确定”。", + "sketch_panel.move_hint": "输入距离和角度,然后按“确定”。", + "sketch_panel.redefine_title": "{command}:{name}", + "sketch_panel.sheet_attachment": "附着到钣金实体的平面上;钣金变化时会跟随该面板。", + "sketch_panel.text_hint": "编辑文字及其位置,然后按“确定”。", + "sketch_panel.use_plane": "使用 {plane} 平面", "sketch_text.align_center": "居中", "sketch_text.align_left": "左对齐", "sketch_text.align_right": "右对齐", @@ -1205,6 +1215,7 @@ "ui.combine": "组合", "ui.coming_later": "即将推出", "ui.command_done": "{command} 完成", + "ui.command_palette_hint": "输入命令,例如 {example} — 或按 S 搜索", "ui.concentric": "同心", "ui.configurations": "配置", "ui.conic_curve": "圆锥曲线", @@ -1475,8 +1486,11 @@ "ui.orbit_around": "环绕", "ui.orientation": "定向", "ui.origin": "原点", + "ui.palette_construction_mode": "构造模式 (X)", + "ui.palette_more": "更多", "ui.palette_points": "点", "ui.palette_profile": "轮廓", + "ui.palette_sketch_options": "草图选项", "ui.pan": "平移", "ui.pan_zoom_orbit": "平移、缩放、环绕", "ui.parallel": "平行", diff --git a/assets/styles/ui/palettes.rs b/assets/styles/ui/palettes.rs index c2052dec1..edcdf1272 100644 --- a/assets/styles/ui/palettes.rs +++ b/assets/styles/ui/palettes.rs @@ -31,6 +31,35 @@ impl Tokens { font_label: 12.5, font_button: 13.0, font_heading: 14.0, + font_triad: 8.0, + font_compass: 13.5, + font_subtitle: 15.0, + font_intro: 16.0, + font_article_heading: 17.0, + font_title: 22.0, + font_display: 26.0, + control_height: 24.0, + control_radius: 5, + form_label_width: 70.0, + form_gap_y: 5.0, + form_footer_height: 38.0, + form_header_height: 30.0, + form_card_width: 264.0, + form_icon_size: 18.0, + form_close_size: 22.0, + form_inset: 7.0, + form_icon_inset: 4.5, + form_section_icon_size: 11.0, + form_checkbox_height: 22.0, + form_button_height: 26.0, + sketch_palette_width: 232.0, + sketch_mode_size: 36.0, + sketch_mode_radius: 7, + sketch_mode_border: 1.5, + sketch_palette_alpha: 0.96, + sketch_mode_tint: 0.12, + sketch_footer_icon_size: 15.0, + font_section_tracking: 0.04, app_bar: Color32::from_rgb(52, 56, 64), app_bar_separator: Color32::from_rgb(136, 145, 160), toolbar: Color32::from_rgb(246, 247, 249), @@ -117,6 +146,14 @@ impl Tokens { app_bar_hover_button: Color32::from_rgba_unmultiplied_const(255, 255, 255, 30), app_bar_hover_strong: Color32::from_rgba_unmultiplied_const(255, 255, 255, 40), app_bar_tab_active: Color32::from_rgb(53, 59, 71), + dialog_body: Color32::from_rgb(255, 255, 255), + dialog_footer: Color32::from_rgb(246, 248, 250), + dialog_rule: Color32::from_rgb(230, 234, 240), + control_fill: Color32::from_rgb(255, 255, 255), + control_border: Color32::from_rgb(195, 203, 214), + dialog_label: Color32::from_rgb(58, 70, 86), + selected_ink: Color32::from_rgb(26, 80, 127), + selected_bg: Color32::from_rgb(227, 240, 251), timeline_item: Color32::WHITE, timeline_item_error: Color32::from_rgb(250, 220, 220), timeline_marker: Color32::from_rgb(70, 76, 88), @@ -170,6 +207,36 @@ impl Tokens { } pub const fn dark() -> Tokens { let mut t = Tokens::light(); + // Shared typography and dense form dimensions stay identical in both palettes. + t.font_triad = 8.0; + t.font_compass = 13.5; + t.font_subtitle = 15.0; + t.font_intro = 16.0; + t.font_article_heading = 17.0; + t.font_title = 22.0; + t.font_display = 26.0; + t.control_height = 24.0; + t.control_radius = 5; + t.form_label_width = 70.0; + t.form_gap_y = 5.0; + t.form_footer_height = 38.0; + t.form_header_height = 30.0; + t.form_card_width = 264.0; + t.form_icon_size = 18.0; + t.form_close_size = 22.0; + t.form_inset = 7.0; + t.form_icon_inset = 4.5; + t.form_section_icon_size = 11.0; + t.form_checkbox_height = 22.0; + t.form_button_height = 26.0; + t.sketch_palette_width = 232.0; + t.sketch_mode_size = 36.0; + t.sketch_mode_radius = 7; + t.sketch_mode_border = 1.5; + t.sketch_palette_alpha = 0.96; + t.sketch_mode_tint = 0.12; + t.sketch_footer_icon_size = 15.0; + t.font_section_tracking = 0.04; t.app_bar = Color32::from_rgb(28, 31, 38); t.toolbar = Color32::from_rgb(39, 43, 52); t.panel = Color32::from_rgb(39, 43, 52); @@ -184,6 +251,14 @@ impl Tokens { t.mesh_accent = Color32::from_rgb(133, 113, 0); t.form_accent = Color32::from_rgb(123, 99, 166); t.render_accent = Color32::from_rgb(224, 116, 174); + t.dialog_body = Color32::from_rgb(59, 68, 83); + t.dialog_footer = Color32::from_rgb(47, 52, 62); + t.dialog_rule = Color32::from_rgb(53, 59, 71); + t.control_fill = Color32::from_rgb(39, 43, 52); + t.control_border = Color32::from_rgb(74, 82, 98); + t.dialog_label = Color32::from_rgb(180, 187, 200); + t.selected_ink = Color32::from_rgb(156, 199, 245); + t.selected_bg = Color32::from_rgb(42, 70, 110); t.construction_geom = icon_primary(crate::icon_svg::CONSTRUCTION_PRIMARY[1]); t.error = Color32::from_rgb(240, 100, 96); t.warning = Color32::from_rgb(236, 170, 70); @@ -249,6 +324,7 @@ impl Tokens { t.icons.axes[1] = t.triad[1]; t.icons.access = [good, Color32::from_rgb(217, 102, 13)]; t.construction_geom = icon_primary(crate::icon_svg::CONSTRUCTION_RED_GREEN[dark as usize]); + t.glyph_text = icon_primary(crate::icon_svg::CONSTRAINT_RED_GREEN[dark as usize]); t.icons.draft = [good, Color32::from_rgb(242, 230, 153)]; t.surface_accent = if dark { Color32::from_rgb(200, 135, 55) } else { Color32::from_rgb(164, 80, 0) }; t.mesh_accent = if dark { Color32::from_rgb(190, 175, 70) } else { Color32::from_rgb(130, 103, 0) }; diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index d1bf0fc4b..0f25e308e 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -36,6 +36,10 @@ tiny-skia = { workspace = true } # updated by its installer (MIT; already in the tree as a build dependency). winreg = "0.56" +[dev-dependencies] +# Parse the source guard structurally, including code after inline test modules. +syn = { workspace = true, features = ["visit"] } + # Pictures pasted into the agent chat; already in the tree, with the same features, through # egui-winit's clipboard. [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/crates/ui-egui/build.rs b/crates/ui-egui/build.rs index 797da0514..79c9c0b0f 100644 --- a/crates/ui-egui/build.rs +++ b/crates/ui-egui/build.rs @@ -132,6 +132,7 @@ fn icon_data() -> Result<(), String> { ("CONSTRUCTION_PRIMARY", palette.get("accents").and_then(|v| v.get("construction"))), ("SKETCH_RED_GREEN", palette.get("variants").and_then(|v| v.get("red-green")).and_then(|v| v.get("sketch"))), ("CONSTRUCTION_RED_GREEN", palette.get("variants").and_then(|v| v.get("red-green")).and_then(|v| v.get("construction"))), + ("CONSTRAINT_RED_GREEN", palette.get("variants").and_then(|v| v.get("red-green")).and_then(|v| v.get("constraint"))), ("CONSTRUCTION_BLUE_YELLOW", palette.get("variants").and_then(|v| v.get("blue-yellow")).and_then(|v| v.get("construction"))), ("CONSTRAINT_BLUE_YELLOW", palette.get("variants").and_then(|v| v.get("blue-yellow")).and_then(|v| v.get("constraint"))), ] { diff --git a/crates/ui-egui/src/agent_chat/markdown_view.rs b/crates/ui-egui/src/agent_chat/markdown_view.rs index 2d8d6ebfb..ba8647329 100644 --- a/crates/ui-egui/src/agent_chat/markdown_view.rs +++ b/crates/ui-egui/src/agent_chat/markdown_view.rs @@ -5,6 +5,7 @@ //! so the parsed blocks are kept per conversation item and parsed again only when its text //! changes. +use crate::fonts::RichTextExt as _; use std::hash::{Hash, Hasher}; use std::sync::Arc; @@ -41,9 +42,11 @@ fn job(ui: &egui::Ui, spans: &[Span], size: f32, color: Color32) -> LayoutJob { let plain = TextFormat { font_id: base.clone(), color, ..Default::default() }; match s { Span::Text(x) => j.append(x, 0.0, plain), - Span::Bold(x) => j.append(x, 0.0, TextFormat { color: t.text, ..plain }), + Span::Bold(x) => j.append(x, 0.0, TextFormat { font_id: crate::fonts::semibold(size), color: t.text, ..plain }), Span::Italic(x) => j.append(x, 0.0, TextFormat { italics: true, ..plain }), - Span::Code(x) => j.append(x, 0.0, TextFormat { font_id: FontId::monospace(size - 1.0), background: t.field, ..plain }), + Span::Code(x) => { + j.append(x, 0.0, TextFormat { font_id: FontId::monospace(size - (t.font_button - t.font_body)), background: t.field, ..plain }) + } Span::Link { label, .. } => j.append(label, 0.0, TextFormat { color: t.accent, underline: Stroke::new(1.0, t.accent), ..plain }), } } @@ -58,6 +61,7 @@ fn host(url: &str) -> &str { /// A paragraph's text, then its links as buttons (a laid-out text cannot be clicked in parts). fn spans(ui: &mut egui::Ui, spans: &[Span], size: f32, color: Color32) { + let t = Tokens::get(); ui.add(egui::Label::new(job(ui, spans, size, color)).selectable(true).wrap()); let links: Vec<(&str, &str)> = spans.iter().filter_map(|s| if let Span::Link { label, url } = s { Some((label.as_str(), url.as_str())) } else { None }).collect(); @@ -66,7 +70,7 @@ fn spans(ui: &mut egui::Ui, spans: &[Span], size: f32, color: Color32) { for (label, url) in links { // The text above already shows the label; the button says where it goes. let to = format!("↗ {}", host(url)); - ui.hyperlink_to(RichText::new(to).size(size - 1.0), url).on_hover_text(format!("{label}: {url}")); + ui.hyperlink_to(RichText::new(to).size(size - (t.font_button - t.font_body)), url).on_hover_text(format!("{label}: {url}")); } }); } @@ -75,24 +79,28 @@ fn spans(ui: &mut egui::Ui, spans: &[Span], size: f32, color: Color32) { /// Draw `src` as Markdown. `slot`: the conversation item it belongs to. pub fn show(ui: &mut egui::Ui, slot: usize, src: &str) { let t = Tokens::get(); - let size = 13.0; + let size = t.font_button; let parsed = blocks(ui.ctx(), slot, src); for block in parsed.iter() { match block { Block::Paragraph(s) => spans(ui, s, size, t.text), Block::Heading { level, spans: s } => { let size = match level { - 1 => 17.0, - 2 => 15.0, - _ => 14.0, + 1 => t.font_article_heading, + 2 => t.font_subtitle, + _ => t.font_heading, }; ui.add_space(4.0); - ui.add(egui::Label::new(RichText::new(markdown::plain(s)).size(size).strong().color(t.text)).selectable(true).wrap()); + ui.add(egui::Label::new(RichText::new(markdown::plain(s)).size(size).semibold().color(t.text)).selectable(true).wrap()); } Block::Code { text, .. } => { egui::Frame::NONE.fill(t.field).corner_radius(4.0).inner_margin(Margin::same(6)).show(ui, |ui| { ui.set_width(ui.available_width()); - ui.add(egui::Label::new(RichText::new(text).monospace().size(size - 1.0).color(t.text)).selectable(true).wrap()); + ui.add( + egui::Label::new(RichText::new(text).monospace().size(size - (t.font_button - t.font_body)).color(t.text)) + .selectable(true) + .wrap(), + ); if ui.small_button(tr("ui.agent_chat_copy")).clicked() { ui.ctx().copy_text(text.clone()); } @@ -116,7 +124,7 @@ pub fn show(ui: &mut egui::Ui, slot: usize, src: &str) { } Block::Pre(text) => { egui::ScrollArea::horizontal().id_salt(("agent_chat_pre", slot, text.len())).show(ui, |ui| { - ui.add(egui::Label::new(RichText::new(text).monospace().size(size - 2.0).color(t.text)).selectable(true)); + ui.add(egui::Label::new(RichText::new(text).monospace().size(t.font_small).color(t.text)).selectable(true)); }); } Block::Rule => { diff --git a/crates/ui-egui/src/agent_chat/panel.rs b/crates/ui-egui/src/agent_chat/panel.rs index 8f6c792c2..f4aa88c76 100644 --- a/crates/ui-egui/src/agent_chat/panel.rs +++ b/crates/ui-egui/src/agent_chat/panel.rs @@ -2,6 +2,7 @@ //! or in Preferences), resizable, folded to a thin strip with Minimise, closed with ×. Its side, //! width and fold are preferences, so they come back next time. +use crate::fonts::RichTextExt as _; use egui::{Align, Align2, Color32, Id, Layout, Rect, RichText, Sense, Stroke, pos2, vec2}; use super::*; @@ -134,13 +135,13 @@ fn picture_strip(ui: &mut egui::Ui, n: usize, pictures: &[Picture]) -> Option texture, // Being decoded: a spinner the size of a thumbnail's corner, until it is in. Shown::Loading => { - ui.add(egui::Spinner::new().size(THUMB_MAX.1 / 2.0)); + ui.add(egui::Spinner::new().size(t.space_24)); continue; } // Not a readable picture: its name, or the plain caption. Shown::Failed => { let caption = if picture.note.is_empty() { tr("ui.agent_chat_view_attached").to_string() } else { picture.note.clone() }; - ui.label(RichText::new(caption).color(t.text_dim).size(11.0)); + ui.label(RichText::new(caption).color(t.text_dim).size(t.font_small)); continue; } }; @@ -203,7 +204,7 @@ fn gallery_window(app: &mut SolveApp, ctx: &egui::Context) { crate::scenario::publish_rect("agent_chat:gallery_picture", resp.rect); } Shown::Loading => { - ui.add(egui::Spinner::new().size(32.0)); + ui.add(egui::Spinner::new().size(t.space_24)); } Shown::Failed => { ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim)); @@ -242,7 +243,7 @@ fn drop_hint(ctx: &egui::Context, area: Rect) { let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Foreground, Id::new("sc_agent_chat_drop_hint"))); let zone = area.shrink(6.0); painter.rect(zone, 10.0, t.accent.gamma_multiply(0.16), Stroke::new(2.0, t.accent), egui::StrokeKind::Inside); - let font = egui::FontId::proportional(14.0); + let font = egui::FontId::proportional(Tokens::get().font_heading); let text = painter.layout(tr("ui.agent_chat_drop_hint").to_string(), font, t.text, (zone.width() - 24.0).max(40.0)); let at = zone.center() - text.size() / 2.0; painter.galley(at, text, t.text); @@ -422,7 +423,13 @@ fn strip(app: &mut SolveApp, ui: &mut egui::Ui) { if waiting > 0 { let at = button.right_top() + vec2(-3.0, 3.0); ui.painter().circle_filled(at, 6.5, t.warning); - ui.painter().text(at, Align2::CENTER_CENTER, waiting.min(9).to_string(), egui::FontId::proportional(9.5), t.panel); + ui.painter().text( + at, + Align2::CENTER_CENTER, + waiting.min(9).to_string(), + egui::FontId::proportional(crate::theme::Tokens::get().font_badge), + t.panel, + ); } ui.painter().line_segment( if app.preferences.agent_chat_side == "left" { [r.right_top(), r.right_bottom()] } else { [r.left_top(), r.left_bottom()] }, @@ -451,7 +458,9 @@ fn header(app: &mut SolveApp, ui: &mut egui::Ui, left: bool) { } } } - let l = ui.label(RichText::new(tr("ui.agent_chat")).strong().size(14.0)); + let l = ui.label( + RichText::new(tr("ui.agent_chat")).semibold().color(crate::theme::Tokens::get().text).size(crate::theme::Tokens::get().font_heading), + ); grip.union(l.rect) }; let mut s = state.label().to_string(); @@ -539,7 +548,7 @@ fn dock_drag(app: &mut SolveApp, ui: &egui::Ui, drag: &egui::Response, left: boo zone.center(), Align2::CENTER_CENTER, tr(if to_left { "ui.agent_chat_dock_left" } else { "ui.agent_chat_dock_right" }), - egui::FontId::proportional(14.0), + egui::FontId::proportional(crate::theme::Tokens::get().font_heading), t.text, ); } @@ -693,7 +702,7 @@ pub(super) fn login_chip(ui: &mut egui::Ui, login: &str) { _ => return, }; egui::Frame::NONE.stroke(Stroke::new(1.0, color)).corner_radius(8.0).inner_margin(egui::Margin::symmetric(6, 1)).show(ui, |ui| { - ui.label(RichText::new(text).color(color).size(11.0)); + ui.label(RichText::new(text).color(color).size(crate::theme::Tokens::get().font_small)); }); } @@ -736,29 +745,32 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) { (ui.available_width() - if app.agent_chat.modes.is_empty() { 4.0 } else { 116.0 } - if models { 146.0 } else { 0.0 }).clamp(90.0, 260.0); let mut picked: Option = None; let mut add = false; - let combo = egui::ComboBox::from_id_salt("sc_agent_switch").width(w).selected_text(RichText::new(label).strong()).show_ui(ui, |ui| { - for e in &all { - let sel = current.as_ref().is_some_and(|c| c.id == e.id); - let r = ui.horizontal(|ui| { - kind_icon(ui, e.kind); - let r = ui.selectable_label(sel, &e.name); - ui.label(RichText::new(e.detail()).color(t.text_dim).size(11.0)); - login_chip(ui, e.login); - r - }); - crate::scenario::publish_handle(&format!("agent_chat:agent:{}", e.id), r.inner.rect.center()); - if r.inner.clicked() { - picked = Some(e.id.clone()); + let combo = egui::ComboBox::from_id_salt("sc_agent_switch") + .width(w) + .selected_text(RichText::new(label).semibold().color(crate::theme::Tokens::get().text)) + .show_ui(ui, |ui| { + for e in &all { + let sel = current.as_ref().is_some_and(|c| c.id == e.id); + let r = ui.horizontal(|ui| { + kind_icon(ui, e.kind); + let r = ui.selectable_label(sel, &e.name); + ui.label(RichText::new(e.detail()).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); + login_chip(ui, e.login); + r + }); + crate::scenario::publish_handle(&format!("agent_chat:agent:{}", e.id), r.inner.rect.center()); + if r.inner.clicked() { + picked = Some(e.id.clone()); + } } - } - ui.separator(); - if ui.selectable_label(false, tr("ui.ai_add_agent")).clicked() { - add = true; - } - if ui.selectable_label(false, tr("ui.ai_settings")).clicked() { - crate::prefs::open_at(app, crate::prefs::PAGE_AI); - } - }); + ui.separator(); + if ui.selectable_label(false, tr("ui.ai_add_agent")).clicked() { + add = true; + } + if ui.selectable_label(false, tr("ui.ai_settings")).clicked() { + crate::prefs::open_at(app, crate::prefs::PAGE_AI); + } + }); crate::scenario::publish_handle("agent_chat:switcher", combo.response.rect.center()); combo.response.on_hover_text(tr("ui.ai_switch_tip")); if add { @@ -811,7 +823,7 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) { } }); if let Some(a) = &app.agent_chat.auth_status { - ui.label(RichText::new(a).color(t.text_dim).size(11.0)); + ui.label(RichText::new(a).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); } } @@ -826,7 +838,7 @@ fn picker(app: &mut SolveApp, ui: &mut egui::Ui) { let all = agents::entries(app); let current = agents::current(app); ui.horizontal(|ui| { - ui.label(RichText::new(tr("ui.agent_chat_pick")).strong()); + ui.label(RichText::new(tr("ui.agent_chat_pick")).semibold().color(crate::theme::Tokens::get().text)); ui.with_layout(Layout::right_to_left(Align::Center), |ui| { let refreshing = app.agent_chat.detecting.is_some(); if ui.add_enabled(!refreshing, egui::Button::new(tr("ui.agent_chat_refresh")).small()).clicked() { @@ -847,8 +859,8 @@ fn picker(app: &mut SolveApp, ui: &mut egui::Ui) { ui.set_width(ui.available_width()); ui.horizontal(|ui| { kind_icon(ui, e.kind); - ui.label(RichText::new(&e.name).strong().color(t.text)); - ui.label(RichText::new(e.detail()).color(t.text_dim).size(11.0)); + ui.label(RichText::new(&e.name).semibold().color(t.text)); + ui.label(RichText::new(e.detail()).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); ui.with_layout(Layout::right_to_left(Align::Center), |ui| login_chip(ui, e.login)); }); }); @@ -866,12 +878,16 @@ fn picker(app: &mut SolveApp, ui: &mut egui::Ui) { |ui| { for m in missing { ui.horizontal(|ui| { - ui.label(RichText::new(m.name).strong()); + ui.label(RichText::new(m.name).semibold().color(crate::theme::Tokens::get().text)); if ui.small_button(tr("ui.agent_chat_copy")).on_hover_text(m.install).clicked() { ui.ctx().copy_text(m.install.to_string()); } }); - ui.add(egui::Label::new(RichText::new(m.install).monospace().size(11.0).color(t.text_dim)).selectable(true).wrap()); + ui.add( + egui::Label::new(RichText::new(m.install).monospace().size(crate::theme::Tokens::get().font_small).color(t.text_dim)) + .selectable(true) + .wrap(), + ); } }, ); @@ -883,7 +899,7 @@ fn auth_box(app: &mut SolveApp, ui: &mut egui::Ui) { let t = Tokens::get(); egui::Frame::group(ui.style()).stroke(Stroke::new(1.0, t.warning)).show(ui, |ui| { ui.set_width(ui.available_width()); - ui.label(RichText::new(tr("ui.agent_chat_auth_title")).strong()); + ui.label(RichText::new(tr("ui.agent_chat_auth_title")).semibold().color(crate::theme::Tokens::get().text)); ui.label(RichText::new(tr("ui.agent_chat_auth_needed")).color(t.text_dim)); let methods = app.agent_chat.auth.clone(); let base = app.agent_chat.argv.iter().map(|a| quote(a)).collect::>().join(" "); @@ -893,14 +909,22 @@ fn auth_box(app: &mut SolveApp, ui: &mut egui::Ui) { for m in methods { ui.add_space(4.0); let desc = m.description.trim(); - ui.label(RichText::new(if desc.is_empty() || desc == m.name { m.name.clone() } else { format!("{} — {desc}", m.name) }).strong()); + ui.label( + RichText::new(if desc.is_empty() || desc == m.name { m.name.clone() } else { format!("{} — {desc}", m.name) }) + .semibold() + .color(crate::theme::Tokens::get().text), + ); match &m.kind { acp::AuthKind::Terminal { args, .. } => { ui.label(tr("ui.agent_chat_auth_terminal")); let cmd = format!("{base} {}", args.iter().map(|a| quote(a)).collect::>().join(" ")); ui.horizontal_wrapped(|ui| { egui::Frame::NONE.fill(t.toolbar).corner_radius(4.0).inner_margin(egui::Margin::symmetric(6, 3)).show(ui, |ui| { - ui.add(egui::Label::new(RichText::new(&cmd).monospace().size(11.0)).selectable(true).wrap()); + ui.add( + egui::Label::new(RichText::new(&cmd).monospace().size(crate::theme::Tokens::get().font_small)) + .selectable(true) + .wrap(), + ); }); if ui.small_button(tr("ui.agent_chat_copy")).clicked() { ui.ctx().copy_text(cmd.clone()); @@ -950,7 +974,7 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { } } else if *image { // Taken when the agent starts on the message: nothing to show yet. - ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim).size(11.0)); + ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim).size(t.font_small)); } files_line(ui, files.iter().map(String::as_str)); }); @@ -981,7 +1005,7 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { Item::Permission { title, options, answer: given, .. } => { egui::Frame::group(ui.style()).stroke(Stroke::new(1.0, t.accent)).show(ui, |ui| { ui.set_width(ui.available_width()); - ui.label(RichText::new(trf("ui.agent_chat_permission", &[("title", title)])).strong()); + ui.label(RichText::new(trf("ui.agent_chat_permission", &[("title", title)])).semibold().color(crate::theme::Tokens::get().text)); match given { Some(a) => { ui.label(RichText::new(trf("ui.agent_chat_answered", &[("option", a)])).color(t.text_dim)); @@ -1005,8 +1029,8 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { Item::Approval { id, title, tool, answer: given } => { egui::Frame::group(ui.style()).stroke(Stroke::new(1.5, t.warning)).show(ui, |ui| { ui.set_width(ui.available_width()); - ui.label(RichText::new(tr("ui.agent_chat_approval")).strong()); - ui.add(egui::Label::new(RichText::new(title).monospace().size(11.5)).selectable(true).wrap()); + ui.label(RichText::new(tr("ui.agent_chat_approval")).semibold().color(crate::theme::Tokens::get().text)); + ui.add(egui::Label::new(RichText::new(title).monospace().size(crate::theme::Tokens::get().font_caption)).selectable(true).wrap()); match given { Some(true) => { ui.label(RichText::new(tr("ui.agent_chat_allowed")).color(t.text_dim)); @@ -1039,9 +1063,9 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { Item::Changes { steps, doc, undone } => { ui.horizontal(|ui| { let text = trf("ui.agent_chat_changes", &[("n", &steps.to_string())]); - ui.label(RichText::new(text).color(t.text_dim).size(11.5)); + ui.label(RichText::new(text).color(t.text_dim).size(crate::theme::Tokens::get().font_caption)); if *undone { - ui.label(RichText::new(tr("ui.agent_chat_undone")).color(t.text_dim).size(11.5)); + ui.label(RichText::new(tr("ui.agent_chat_undone")).color(t.text_dim).size(crate::theme::Tokens::get().font_caption)); } else if Arc::ptr_eq(doc, ¤t_doc) { let b = ui.button(tr("ui.agent_chat_undo_changes")).on_hover_text(tr("ui.ai_undo_tip")); crate::scenario::publish_handle("agent_chat:undo", b.rect.center()); @@ -1071,15 +1095,19 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { ui.set_width(ui.available_width()); ui.horizontal(|ui| { let tag = if stopped && !busy { "ui.agent_chat_queued_stopped" } else { "ui.agent_chat_queued" }; - ui.label(RichText::new(tr(tag)).color(t.accent).strong().size(11.0)); + ui.label(RichText::new(tr(tag)).color(t.accent).semibold().size(crate::theme::Tokens::get().font_small)); ui.with_layout(Layout::right_to_left(Align::Center), |ui| { - let x = ui.add(egui::Button::new(RichText::new("×").size(14.0)).frame(false)).on_hover_text(tr("ui.agent_chat_remove")); + let x = ui + .add(egui::Button::new(RichText::new("×").size(crate::theme::Tokens::get().font_heading)).frame(false)) + .on_hover_text(tr("ui.agent_chat_remove")); crate::scenario::publish_handle(&format!("agent_chat:pending_remove:{n}"), x.rect.center()); if x.clicked() { remove = Some(n); } if editing.as_ref().is_none_or(|(i, _)| *i != n) { - let e = ui.add(egui::Button::new(RichText::new(tr("ui.agent_chat_edit")).size(11.5)).frame(false)); + let e = ui.add( + egui::Button::new(RichText::new(tr("ui.agent_chat_edit")).size(crate::theme::Tokens::get().font_caption)).frame(false), + ); crate::scenario::publish_handle(&format!("agent_chat:pending_edit:{n}"), e.rect.center()); if e.clicked() { start_edit = Some((n, p.text.clone())); @@ -1105,7 +1133,7 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { ui.add(egui::Label::new(RichText::new(&p.text).color(t.text)).selectable(true).wrap()); } if p.image { - ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim).size(11.0)); + ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); } files_line(ui, p.files.iter().map(|f| f.name.as_str())); } @@ -1134,7 +1162,7 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) { ui.add_space(12.0); ui.label(RichText::new(tr("ui.agent_chat_intro")).color(t.text_dim)); ui.add_space(6.0); - ui.label(RichText::new(tr("ui.agent_chat_privacy")).color(t.text_dim).size(11.0)); + ui.label(RichText::new(tr("ui.agent_chat_privacy")).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); } if let Some((n, text)) = edit_done { if let (Some(text), Some(p)) = (text.filter(|t| !t.trim().is_empty()), app.agent_chat.pending.get_mut(n)) { @@ -1173,7 +1201,7 @@ fn files_line<'a>(ui: &mut egui::Ui, names: impl Iterator) { let list = names.collect::>().join(", "); if !list.is_empty() { let t = Tokens::get(); - ui.add(egui::Label::new(RichText::new(trf("ui.agent_chat_files", &[("files", &list)])).color(t.text_dim).size(11.0)).wrap()); + ui.add(egui::Label::new(RichText::new(trf("ui.agent_chat_files", &[("files", &list)])).color(t.text_dim).size(t.font_small)).wrap()); } } @@ -1248,11 +1276,11 @@ fn loading_chip(ui: &mut egui::Ui, name: &str, importing: bool, i: usize, w: f32 ui.horizontal(|ui| { ui.spacing_mut().item_spacing.x = 4.0; let doing = tr(if importing { "ui.agent_chat_file_importing" } else { "ui.agent_chat_file_loading" }); - let mark = ui.add(egui::Spinner::new().size(16.0)).on_hover_text(doing).rect.width(); + let mark = ui.add(egui::Spinner::new().size(t.form_icon_size)).on_hover_text(doing).rect.width(); let name_w = (inner - mark - 18.0 - 8.0).max(8.0); ui.allocate_ui(vec2(name_w, 20.0), |ui| { ui.set_width(name_w); - ui.add(egui::Label::new(RichText::new(name).size(11.5).color(t.text_dim)).truncate()) + ui.add(egui::Label::new(RichText::new(name).size(t.font_small).color(t.text_dim)).truncate()) }) .inner .on_hover_text(name); @@ -1295,14 +1323,20 @@ fn chip(ui: &mut egui::Ui, thumbs: &mut std::collections::HashMap) { let tk = Tokens::get(); match t { Some(Test::Running(_)) => { - ui.label(RichText::new(tr("ui.ai_testing")).color(tk.text_dim).size(11.0)); + ui.label(RichText::new(tr("ui.ai_testing")).color(tk.text_dim).size(crate::theme::Tokens::get().font_small)); } Some(Test::Done(Ok(m))) => { - ui.label(RichText::new(m.clone()).color(tk.accent).size(11.0)); + ui.label(RichText::new(m.clone()).color(tk.accent).size(crate::theme::Tokens::get().font_small)); } Some(Test::Done(Err(e))) => { - ui.add(egui::Label::new(RichText::new(e).color(tk.error).size(11.0)).wrap()); + ui.add(egui::Label::new(RichText::new(e).color(tk.error).size(crate::theme::Tokens::get().font_small)).wrap()); } None => {} } @@ -106,19 +107,20 @@ fn test_line(ui: &mut egui::Ui, t: &Option<&Test>) { fn section(ui: &mut egui::Ui, title: &str) { ui.add_space(10.0); - ui.label(RichText::new(title).strong().size(13.0)); + ui.label(RichText::new(title).semibold().color(crate::theme::Tokens::get().text).size(crate::theme::Tokens::get().font_button)); ui.separator(); } fn note(ui: &mut egui::Ui, text: &str) { let t = Tokens::get(); - ui.add(egui::Label::new(RichText::new(text).size(11.0).color(t.text_dim)).wrap()); + ui.add(egui::Label::new(RichText::new(text).size(crate::theme::Tokens::get().font_small).color(t.text_dim)).wrap()); } /// The AI page of Settings. pub fn page(app: &mut SolveApp, ui: &mut egui::Ui) { let t = Tokens::get(); - let r = ui.checkbox(&mut app.preferences.ai_features, RichText::new(tr("ui.ai_show_features")).strong()); + let r = + ui.checkbox(&mut app.preferences.ai_features, RichText::new(tr("ui.ai_show_features")).semibold().color(crate::theme::Tokens::get().text)); crate::scenario::publish_handle("prefs:ai_features", r.rect.center()); note(ui, tr("ui.ai_show_features_note")); if cfg!(target_arch = "wasm32") { @@ -163,7 +165,7 @@ pub fn page(app: &mut SolveApp, ui: &mut egui::Ui) { let remembered: Vec<(String, Vec)> = app.preferences.agent_always_allow.iter().filter(|(_, v)| !v.is_empty()).map(|(k, v)| (k.clone(), v.clone())).collect(); ui.add_space(4.0); - ui.label(RichText::new(tr("ui.ai_always_allowed")).strong()); + ui.label(RichText::new(tr("ui.ai_always_allowed")).semibold().color(crate::theme::Tokens::get().text)); if remembered.is_empty() { note(ui, tr("ui.ai_always_allowed_none")); } @@ -172,7 +174,7 @@ pub fn page(app: &mut SolveApp, ui: &mut egui::Ui) { ui.horizontal_wrapped(|ui| { ui.label(names.get(&agent).cloned().unwrap_or_else(|| agent.clone())); for tool in &tools { - ui.label(RichText::new(tool).monospace().size(11.0).color(t.text_dim)); + ui.label(RichText::new(tool).monospace().size(crate::theme::Tokens::get().font_small).color(t.text_dim)); } if ui.small_button(tr("ui.ai_reset")).clicked() { app.preferences.agent_always_allow.remove(&agent); @@ -230,11 +232,11 @@ fn agents_section(app: &mut SolveApp, ui: &mut egui::Ui) { ui.set_width(ui.available_width()); ui.horizontal(|ui| { super::panel::kind_icon(ui, e.kind); - ui.label(RichText::new(&e.name).strong()); - ui.label(RichText::new(e.detail()).color(t.text_dim).size(11.0)); + ui.label(RichText::new(&e.name).semibold().color(crate::theme::Tokens::get().text)); + ui.label(RichText::new(e.detail()).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); super::panel::login_chip(ui, e.login); if !e.found { - ui.label(RichText::new(tr("ui.ai_added")).color(t.text_dim).size(11.0)); + ui.label(RichText::new(tr("ui.ai_added")).color(t.text_dim).size(crate::theme::Tokens::get().font_small)); } }); ui.horizontal(|ui| { @@ -388,7 +390,12 @@ pub fn dialog(app: &mut SolveApp, ctx: &egui::Context) { ui.add(egui::TextEdit::singleline(&mut s.command).desired_width(300.0)); ui.end_row(); ui.label(""); - ui.add(egui::Label::new(RichText::new(tr("ui.ai_add_installed_note")).size(11.0).color(t.text_dim)).wrap()); + ui.add( + egui::Label::new( + RichText::new(tr("ui.ai_add_installed_note")).size(crate::theme::Tokens::get().font_small).color(t.text_dim), + ) + .wrap(), + ); ui.end_row(); } AddKind::Custom => { @@ -399,7 +406,12 @@ pub fn dialog(app: &mut SolveApp, ctx: &egui::Context) { ui.add(egui::TextEdit::singleline(&mut s.command).hint_text("my-agent --acp").desired_width(300.0)); ui.end_row(); ui.label(""); - ui.add(egui::Label::new(RichText::new(tr("ui.agent_chat_custom_hint")).size(11.0).color(t.text_dim)).wrap()); + ui.add( + egui::Label::new( + RichText::new(tr("ui.agent_chat_custom_hint")).size(crate::theme::Tokens::get().font_small).color(t.text_dim), + ) + .wrap(), + ); ui.end_row(); } AddKind::Api => { @@ -437,7 +449,7 @@ pub fn dialog(app: &mut SolveApp, ctx: &egui::Context) { ui.end_row(); ui.label(""); let note = if has_keychain { tr("ui.ai_key_note") } else { tr("ui.ai_no_keychain") }; - ui.add(egui::Label::new(RichText::new(note).size(11.0).color(t.text_dim)).wrap()); + ui.add(egui::Label::new(RichText::new(note).size(crate::theme::Tokens::get().font_small).color(t.text_dim)).wrap()); ui.end_row(); ui.label(""); ui.horizontal(|ui| { diff --git a/crates/ui-egui/src/agent_chat/tests.rs b/crates/ui-egui/src/agent_chat/tests.rs index 26246fd72..193abff08 100644 --- a/crates/ui-egui/src/agent_chat/tests.rs +++ b/crates/ui-egui/src/agent_chat/tests.rs @@ -79,7 +79,7 @@ fn ask(tx: &Sender, method: &str, params: Value) -> Receiver (SolveApp, Script, egui::Context) { let script = Script::default(); app.agent_chat.backend = Some(Box::new(script.clone())); app.agent_chat.state = Some(State::Ready); - (app, script, egui::Context::default()) + (app, script, crate::fonts::test_context()) } fn ended(script: &Script, reason: &str) { @@ -631,7 +631,7 @@ done let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default()); app.agent_chat.backend = Some(Box::new(acp_client::AcpBackend::start(&argv, start).unwrap())); app.agent_chat.state = Some(State::Starting); - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); let until = |app: &mut SolveApp, what: &str, done: &dyn Fn(&SolveApp) -> bool| { let t = std::time::Instant::now(); while !done(app) { @@ -724,7 +724,7 @@ done let mut app = SolveApp::new(solidcraft_engine::Session::default(), crate::Services::default()); app.agent_chat.backend = Some(Box::new(acp_client::AcpBackend::start(&argv, start).unwrap())); app.agent_chat.state = Some(State::Starting); - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); let until = |app: &mut SolveApp, done: &dyn Fn(&SolveApp) -> bool| { let t = std::time::Instant::now(); while !done(app) { @@ -842,7 +842,7 @@ done app.agent_chat.state = Some(State::Starting); app.agent_chat.running_id = "fake".into(); app.preferences.agent_models.insert("fake".into(), "smart".into()); - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); let t = std::time::Instant::now(); loop { poll(&mut app, &ctx); diff --git a/crates/ui-egui/src/bom_panel.rs b/crates/ui-egui/src/bom_panel.rs index 5bab059de..6694eef3a 100644 --- a/crates/ui-egui/src/bom_panel.rs +++ b/crates/ui-egui/src/bom_panel.rs @@ -89,7 +89,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { let bom = d.rows(app); let rows: Vec = bom["rows"].as_array().cloned().unwrap_or_default(); let (mut export, mut apply_row) = (None, None); - let title = RichText::new(crate::i18n::tr_label("Bill of Materials")).strong().size(13.0); + let title = RichText::new(crate::i18n::tr_label("Bill of Materials")).strong().size(t.font_button); crate::frame::window(ctx, title, crate::frame::Width::Wide).id(egui::Id::new("sc_bom")).open(&mut open).resizable(true).show(ctx, |ui| { ui.horizontal(|ui| { let was = (d.top, d.by_definition, d.group_children); diff --git a/crates/ui-egui/src/browser.rs b/crates/ui-egui/src/browser.rs index d89567027..f083115b9 100644 --- a/crates/ui-egui/src/browser.rs +++ b/crates/ui-egui/src/browser.rs @@ -6,6 +6,7 @@ //! viewport, a double-click on a sketch edits it, and a right-click opens the item's menu //! ([`crate::context_menu`]). +use crate::fonts::RichTextExt as _; #[cfg(test)] #[path = "occurrence_ui_tests.rs"] mod occurrence_ui_tests; @@ -176,14 +177,14 @@ pub fn group_name(app: &SolveApp, id: u64) -> Option { pub fn group_items(app: &SolveApp, id: u64, scope: &str) -> Vec { let Some(g) = find_group(app, id) else { return Vec::new() }; let mut v = vec![ - Item::action("ui.rename", "Rename", "").with(json!({ "group": id })), + Item::action("ui.rename", "Rename", "rename").with(json!({ "group": id })), Item::action("ui.ungroup", "Ungroup", "folder").with(json!({ "group": id })), Item::sep(), // The group itself: its items keep their own state. Item::action("ui.folderVisible", "Show/Hide", "eye").key("V").with(json!({ "key": format!("{scope}/g{id}") })), ]; if g.folder == "bodies" { - v.push(Item::action("ui.isolate", "Isolate", "").with(json!({ "bodies": group_bodies(app, id) }))); + v.push(Item::action("ui.isolate", "Isolate", "body").with(json!({ "bodies": group_bodies(app, id) }))); } v } @@ -426,10 +427,14 @@ pub(crate) fn draw_row(ui: &mut egui::Ui, id: egui::Id, row: &Row) -> RowResp { icons::paint_icon(ui.painter(), ir, row.icon, if row.dim { DIM_ICON_OPACITY } else { 1.0 }); x += 21.0; } - let col = - if row.selected { crate::theme::TabAccent::current(ui.ctx()).color } else { row.color.unwrap_or(if row.dim { t.text_dim } else { t.text }) }; + let col = if row.selected { + crate::theme::selected_ink(&t, crate::theme::TabAccent::current(ui.ctx()).color) + } else { + row.color.unwrap_or(if row.dim { t.text_dim } else { t.text }) + }; let label_display = if row.name { crate::i18n::tr_name(row.label) } else { crate::i18n::tr_dyn(row.label) }; - let galley = ui.painter().layout_no_wrap(label_display, FontId::proportional(t.font_label), col); + let font = if row.selected { crate::fonts::semibold(t.font_label) } else { FontId::proportional(t.font_label) }; + let galley = ui.painter().layout_no_wrap(label_display, font, col); let lw = galley.size().x; ui.painter().galley(pos2(x, cy - galley.size().y / 2.0), galley, col); let mut bx = (x + lw + 6.0).min(r.right() - 16.0); @@ -673,7 +678,7 @@ fn browser_panel(app: &mut SolveApp, ui: &mut egui::Ui, timeline_above: bool) { DRAWN.with(|d| d.borrow_mut().clear()); OCCURRENCES.with(|d| d.borrow_mut().clear()); let mut acts = Actions::default(); - let width = browser_width(app); + let width = browser_width(app.preferences.browser_width); let panel = egui::Panel::left("sc_browser") .exact_size(width) .resizable(false) @@ -704,8 +709,8 @@ fn browser_panel(app: &mut SolveApp, ui: &mut egui::Ui, timeline_above: bool) { crate::scenario::publish_handle("left-history-divider", rect.center()); } let arrow = if browser_collapsed { "▶" } else { "▼" }; - let response = - ui.add(egui::Button::new(RichText::new(format!("{arrow} BROWSER")).size(t.font_small).strong().color(t.text_dim)).frame(false)); + let response = ui + .add(egui::Button::new(RichText::new(format!("{arrow} BROWSER")).size(t.font_small).semibold().color(t.text_dim)).frame(false)); crate::scenario::publish_handle("left-browser-toggle", response.rect.center()); if response.clicked() { app.preferences.timeline_left_browser_collapsed = !browser_collapsed; @@ -722,8 +727,7 @@ fn browser_panel(app: &mut SolveApp, ui: &mut egui::Ui, timeline_above: bool) { finish_browser(app, ui, acts); } -fn browser_width(app: &SolveApp) -> f32 { - let remembered = app.preferences.browser_width; +fn browser_width(remembered: f32) -> f32 { if remembered.is_finite() { remembered.clamp(MIN_BROWSER_WIDTH, MAX_BROWSER_WIDTH) } else { crate::prefs::DEFAULT_BROWSER_WIDTH } } @@ -749,11 +753,8 @@ pub fn floating(app: &mut SolveApp, ui: &mut egui::Ui, available: Rect) { let mut acts = Actions::default(); let gap = crate::shell::SHELL_GAP; let top_gap = if app.ui.layout == crate::shell::LayoutMode::Docked { gap } else { 0.0 }; - let min = available.min + vec2(gap, top_gap); - let right = (available.right() - gap).max(min.x); - let bottom = app.shell.history.map_or(available.bottom() - gap, |r| r.top() - gap).max(min.y); - let width = browser_width(app); - let bounds = Rect::from_min_max(min, pos2((min.x + width).min(right), bottom)); + let width = browser_width(app.preferences.browser_width); + let bounds = floating_bounds(available, app.shell.history, width, top_gap); app.shell.browser = None; let min_height = HEADER_H + 2.0 * (CARD_INSET + 1.0); if bounds.is_positive() && bounds.height() >= min_height { @@ -780,6 +781,14 @@ pub fn floating(app: &mut SolveApp, ui: &mut egui::Ui, available: Rect) { finish_browser(app, ui, acts); } +fn floating_bounds(available: Rect, history: Option, width: f32, top_gap: f32) -> Rect { + let gap = crate::shell::SHELL_GAP; + let min = available.min + vec2(gap, top_gap); + let right = (available.right() - gap).max(min.x); + let bottom = history.map_or(available.bottom() - gap, |r| r.top() - gap).max(min.y); + Rect::from_min_max(min, pos2((min.x + width).min(right), bottom)) +} + fn browser_contents(app: &mut SolveApp, ui: &mut egui::Ui, acts: &mut Actions, collapsible: bool) { let t = Tokens::get(); // Only the floating card folds; the docked column keeps its full height. @@ -811,7 +820,7 @@ fn browser_header(app: &mut SolveApp, ui: &mut egui::Ui, collapsible: bool) { let title = crate::i18n::tr("ui.browser_title").to_string(); let kind = if collapsible { egui::WidgetType::Button } else { egui::WidgetType::Label }; response.widget_info(|| egui::WidgetInfo::labeled(kind, true, &title)); - let galley = ui.painter().layout_no_wrap(title, FontId::proportional(t.font_heading), t.text); + let galley = ui.painter().layout_no_wrap(title, crate::fonts::semibold(t.font_heading), t.text); ui.painter().galley(pos2(rect.left() + t.space_6, rect.center().y - galley.size().y / 2.0), galley, t.text); let mut right = rect.right() - t.space_6; if collapsible { @@ -921,8 +930,7 @@ fn finish_browser(app: &mut SolveApp, ui: &mut egui::Ui, acts: Actions) { occurrence_panel(app, ui); capture_prompt(app, ui.ctx()); canvas_panel(app, ui.ctx()); - let repair_anchor = app.viewport.rect.map(|rect| rect.right_top() + vec2(-16.0, 16.0)).unwrap_or_else(|| ui.ctx().content_rect().right_top()); - crate::sketch_attachment_ui::panel(app, ui.ctx(), repair_anchor); + crate::sketch_attachment_ui::panel(app, ui.ctx()); } fn component_name(app: &SolveApp, id: u64) -> String { @@ -1327,7 +1335,7 @@ pub fn view_items(app: &SolveApp, name: &str) -> Vec { Item::action("ui.restoreView", "Restore", "home").with(json!({ "view": name })), Item::action("ui.updateView", "Update to Current View", "perspective").with(json!({ "view": name })).on_if(saved), Item::sep(), - Item::action("ui.rename", "Rename", "").with(json!({ "view": name })).on_if(saved), + Item::action("ui.rename", "Rename", "rename").with(json!({ "view": name })).on_if(saved), Item::action("view.delete", "Delete", "delete").with(json!({ "view": name })).on_if(saved), ] } @@ -1508,7 +1516,7 @@ pub fn canvas_items(app: &SolveApp, id: u64) -> Vec { Item::action("ui.calibrateCanvas", "Calibrate", "measure").with(json!({ "canvas": id })), Item::sep(), Item::action("ui.delete", "Delete", "delete").with(json!({ "canvases": [id] })), - Item::action("ui.rename", "Rename", "").with(json!({ "canvas": id })), + Item::action("ui.rename", "Rename", "rename").with(json!({ "canvas": id })), Item::sep(), Item::action("ui.canvasVisible", "Show/Hide", "eye").key("V").with(json!({ "canvas": id, "visible": !visible })), ] @@ -2340,9 +2348,12 @@ pub fn dims_overlay(app: &SolveApp, ctx: &egui::Context) { } } -/// Where the browser's panels open: the viewport's top left corner. +/// Keep browser panels beside the browser and below the ribbon, including the floating shell. fn panel_pos(app: &SolveApp) -> Pos2 { - app.viewport.rect.map(|r| crate::shell::content_rect(app, r).left_top() + vec2(16.0, 16.0)).unwrap_or(pos2(270.0, 140.0)) + app.viewport + .rect + .map(|r| crate::shell::content_rect(app, r).left_top() + vec2(Tokens::get().space_16, Tokens::get().space_16)) + .unwrap_or(pos2(270.0, 140.0)) } /// The Capture Position question stands for saving. diff --git a/crates/ui-egui/src/browser_card_tests.rs b/crates/ui-egui/src/browser_card_tests.rs index 6f3308687..2ca4bd7b9 100644 --- a/crates/ui-egui/src/browser_card_tests.rs +++ b/crates/ui-egui/src/browser_card_tests.rs @@ -47,7 +47,7 @@ fn browser_card_shrinks_and_scrolls_without_covering_history() { fn selected_row_paints_tab_soft_fill_and_accent_text_in_both_layouts() { for mode in [LayoutMode::Floating, LayoutMode::Docked] { for tab in ["MODEL", "SURFACE", "SKETCH"] { - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); let mut app = SolveApp::new(Default::default(), Default::default()); app.ui.layout = mode; app.ui.tab = tab.into(); @@ -64,7 +64,7 @@ fn selected_row_paints_tab_soft_fill_and_accent_text_in_both_layouts() { assert!( out.shapes .iter() - .any(|s| matches!(&s.shape, egui::Shape::Text(t) if t.galley.text() == "Selected body" && t.fallback_color == accent.color)) + .any(|s| matches!(&s.shape, egui::Shape::Text(t) if t.galley.text() == "Selected body" && t.fallback_color == crate::theme::selected_ink(&Tokens::get(), accent.color))) ); } } @@ -167,3 +167,72 @@ fn one_browser_keeps_its_resized_width_across_layouts_and_overlay_preferences() } } } +#[test] +fn browser_title_uses_a_single_semibold_run() { + let ctx = crate::fonts::test_context(); + let mut app = SolveApp::new(Default::default(), Default::default()); + let mut output = ctx.run_ui(egui::RawInput::default(), |ui| { + ui.set_width(250.0); + browser_header(&mut app, ui, true); + }); + output.textures_delta.clear(); + let title = crate::i18n::tr("ui.browser_title"); + let titles: Vec<_> = output + .shapes + .iter() + .filter_map(|s| match &s.shape { + egui::Shape::Text(text) if text.galley.text() == title => Some(text), + _ => None, + }) + .collect(); + assert_eq!(titles.len(), 1); + assert_eq!(titles[0].galley.job.sections[0].format.font_id, crate::fonts::semibold(Tokens::get().font_heading)); +} + +#[test] +fn resizing_browser_card_and_column_persists_width_including_floating_preference() { + for (mode, float, left_history) in [ + (LayoutMode::Floating, false, false), + (LayoutMode::Docked, false, false), + (LayoutMode::Docked, true, false), + (LayoutMode::Floating, true, true), + (LayoutMode::Docked, true, true), + ] { + let mut h = Harness::new(); + h.app.ui.layout = mode; + h.app.preferences.browser_float = float; + h.app.preferences.timeline_left = left_history; + h.call("ui.resize", json!({"width":1400,"height":900})); + h.settle(); + let before = h.app.viewport.rect.unwrap(); + let at = handle_at("left-browser-rail").unwrap(); + h.call("ui.drag", json!({"x0":at.x,"y0":at.y,"x1":at.x+80.0,"y1":at.y,"steps":8})); + h.settle(); + let width = h.app.preferences.browser_width; + assert!(width > crate::prefs::DEFAULT_BROWSER_WIDTH + 40.0, "{mode:?}, float={float}, width={width}"); + if mode == LayoutMode::Floating || float { + assert!((rect_of("browser:card").unwrap().width() - width).abs() < 1.0); + assert_eq!(h.app.viewport.rect.unwrap(), before, "the card leaves the projection intact"); + } else { + assert!((h.app.viewport.rect.unwrap().left() - width).abs() < 1.0); + } + let mut restored = SolveApp::new(Default::default(), Default::default()); + restored.load_prefs(&h.app.prefs()); + assert_eq!(restored.preferences.browser_width, width); + assert_eq!(restored.preferences.browser_float, float); + } +} + +#[test] +fn browser_width_rejects_hostile_preferences_and_tiny_windows_still_fit() { + for width in [f32::NAN, f32::INFINITY, f32::NEG_INFINITY] { + assert_eq!(browser_width(width), crate::prefs::DEFAULT_BROWSER_WIDTH); + } + assert_eq!(browser_width(-100.0), MIN_BROWSER_WIDTH); + assert_eq!(browser_width(f32::MAX), MAX_BROWSER_WIDTH); + let available = Rect::from_min_size(Pos2::ZERO, vec2(100.0, 300.0)); + for top_gap in [0.0, crate::shell::SHELL_GAP] { + let bounds = floating_bounds(available, None, MAX_BROWSER_WIDTH, top_gap); + assert!(available.contains_rect(bounds)); + } +} diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 6a96c74ae..960c6c491 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -571,7 +571,7 @@ fn value_box(ui: &mut egui::Ui, label: &str, value: &mut String, at: Pos2, selec crate::frame::area(egui::Id::new("sc_canvas_area")).fixed_pos(at).order(egui::Order::Foreground).show(ui.ctx(), |ui| { egui::Frame::popup(ui.style()).inner_margin(egui::Margin::symmetric(6, 3)).show(ui, |ui| { ui.horizontal(|ui| { - ui.label(egui::RichText::new(crate::i18n::tr_label(label)).color(t.text_dim).size(11.5)); + ui.label(egui::RichText::new(crate::i18n::tr_label(label)).color(t.text_dim).size(crate::theme::Tokens::get().font_caption)); let r = ui.add(egui::TextEdit::singleline(value).id(id).desired_width(72.0)); crate::params_dialog::complete(ui, &r, value); if select_all { @@ -889,7 +889,7 @@ fn measure_line(app: &SolveApp, painter: &egui::Painter, proj: &Proj, r: &serde_ painter.circle(s, 3.5, t.manipulator, Stroke::new(1.0, Color32::WHITE)); } let mid = sa + (sb - sa) * 0.5 + vec2(10.0, -14.0); - let galley = painter.layout_no_wrap(crate::prefs::show_mm(app, d, 1), egui::FontId::proportional(12.5), t.text); + let galley = painter.layout_no_wrap(crate::prefs::show_mm(app, d, 1), egui::FontId::proportional(crate::theme::Tokens::get().font_label), t.text); let rect = egui::Rect::from_min_size(mid, galley.size() + vec2(10.0, 6.0)); crate::scenario::publish_handle("measure:label", rect.center()); crate::scenario::publish_rect("measure:label", rect); @@ -931,7 +931,7 @@ fn measure_components(app: &SolveApp, painter: &egui::Painter, proj: &Proj, a: V (total.center(), vec2(20.0, 20.0)) }; let text = format!("{}: {}", axis.to_uppercase(), crate::prefs::show_mm(app, distance, 1)); - let galley = painter.layout_no_wrap(text, egui::FontId::proportional(12.5), t.text); + let galley = painter.layout_no_wrap(text, egui::FontId::proportional(crate::theme::Tokens::get().font_label), t.text); let size = galley.size() + vec2(10.0, 6.0); let bounds = proj.rect.shrink(4.0); let clamp = |rect: egui::Rect| { diff --git a/crates/ui-egui/src/colour_tokens_tests.rs b/crates/ui-egui/src/colour_tokens_tests.rs index 82a1b7d74..8239e2330 100644 --- a/crates/ui-egui/src/colour_tokens_tests.rs +++ b/crates/ui-egui/src/colour_tokens_tests.rs @@ -121,23 +121,30 @@ fn colours_outside_the_theme_are_only_the_listed_neutral_ones() { let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); let dirs = [root.join("src"), root.join("../../assets/icons/ui/source")]; let mut found = Vec::new(); - for dir in &dirs { - let entries = std::fs::read_dir(dir).unwrap_or_else(|e| panic!("{}: {e}", dir.display())); - for entry in entries.flatten() { - let path = entry.path(); - let name = path.file_name().and_then(|n| n.to_str()).unwrap_or_default().to_string(); - if !name.ends_with(".rs") || name.ends_with("_tests.rs") || name == "theme.rs" { + fn scan(dir: &std::path::Path, prefix: &str, found: &mut Vec) { + for entry in std::fs::read_dir(dir).unwrap() { + let path = entry.unwrap().path(); + let name = path.file_name().unwrap().to_str().unwrap(); + let relative = format!("{prefix}{name}"); + if path.is_dir() { + scan(&path, &format!("{relative}/"), found); continue; } - let src = std::fs::read_to_string(&path).unwrap_or_default(); + if !name.ends_with(".rs") || name.ends_with("_tests.rs") || matches!(name, "theme.rs" | "gallery.rs" | "test_support.rs") { + continue; + } + let src = std::fs::read_to_string(&path).unwrap(); let code = src.split("#[cfg(test)]").next().unwrap_or(&src); let n: usize = COLOUR_LITERALS.iter().map(|p| code.matches(p).count()).sum(); - let allowed = ALLOWED_LITERALS.iter().find(|(f, _, _)| *f == name).map_or(0, |(_, n, _)| *n); + let allowed = ALLOWED_LITERALS.iter().find(|(f, _, _)| *f == relative).map_or(0, |(_, n, _)| *n); if n > allowed { - found.push(format!("{name}: {n} colour literal(s), at most {allowed} allowed")); + found.push(format!("{relative}: {n} colour literal(s), at most {allowed} allowed")); } } } + for dir in &dirs { + scan(dir, "", &mut found); + } assert!(found.is_empty(), "colour literals outside theme::Tokens: {found:?}"); } diff --git a/crates/ui-egui/src/colour_vision_tests.rs b/crates/ui-egui/src/colour_vision_tests.rs index 4e028c73b..0a01ec3e2 100644 --- a/crates/ui-egui/src/colour_vision_tests.rs +++ b/crates/ui-egui/src/colour_vision_tests.rs @@ -399,11 +399,48 @@ const NO_MEANING: &[(&str, &str)] = &[ ("font_label", "layout dimension"), ("font_button", "layout dimension"), ("font_heading", "layout dimension"), + ("font_triad", "layout dimension"), + ("font_compass", "layout dimension"), + ("font_subtitle", "layout dimension"), + ("font_intro", "layout dimension"), + ("font_article_heading", "layout dimension"), + ("font_title", "layout dimension"), + ("font_display", "layout dimension"), + ("control_height", "layout dimension"), + ("control_radius", "layout dimension"), + ("form_label_width", "layout dimension"), + ("form_gap_y", "layout dimension"), + ("form_footer_height", "layout dimension"), + ("form_header_height", "layout dimension"), + ("form_card_width", "layout dimension"), + ("form_icon_size", "layout dimension"), + ("form_close_size", "layout dimension"), + ("form_inset", "layout dimension"), + ("form_icon_inset", "layout dimension"), + ("form_section_icon_size", "layout dimension"), + ("form_checkbox_height", "layout dimension"), + ("form_button_height", "layout dimension"), + ("sketch_palette_width", "layout dimension"), + ("sketch_mode_size", "layout dimension"), + ("sketch_mode_radius", "layout dimension"), + ("sketch_mode_border", "layout dimension"), + ("sketch_palette_alpha", "neutral panel opacity"), + ("sketch_mode_tint", "selected background tint of the measured sketch accent"), + ("sketch_footer_icon_size", "layout dimension"), + ("font_section_tracking", "layout dimension"), ("on_accent", "ink on an accent fill"), ("app_bar_hover_subtle", "translucent hover chrome"), ("app_bar_hover_button", "translucent hover chrome"), ("app_bar_hover_strong", "translucent hover chrome"), ("app_bar_tab_active", "the active document tab's surface"), + ("dialog_body", "dense dialog surface"), + ("dialog_footer", "dense dialog footer band"), + ("dialog_rule", "dense dialog divider"), + ("control_fill", "input control fill"), + ("control_border", "input control border"), + ("dialog_label", "dense dialog field label"), + ("selected_ink", "foreground of selected elements"), + ("selected_bg", "background of selected elements"), ("render_accent", "the Render workspace's identity colour"), // The window's chrome: grounds, text and borders (measured as grounds where meaning sits on them). ("panel_header", "chrome"), @@ -678,7 +715,7 @@ fn each_mode_changes_only_its_table() { ]; let mut red_green_light = red_green_both.into_iter().filter(|name| !["surface_accent", "mesh_accent", "form_accent"].contains(name)).collect::>(); - red_green_light.extend(["sketch_projected", "sketch_locked", "timeline_item_error", "construction_geom"]); + red_green_light.extend(["sketch_projected", "sketch_locked", "timeline_item_error", "construction_geom", "glyph_text"]); for (dark, mode, want) in [ (false, ColorVision::Protan, set(&red_green_light)), (true, ColorVision::Protan, set(&red_green_both)), @@ -695,6 +732,7 @@ fn each_mode_changes_only_its_table() { "sketch_locked", "box_crossing", "construction_geom", + "glyph_text", "preview_sketch", "analysis.hatch", ]), diff --git a/crates/ui-egui/src/configuration_rules_ui.rs b/crates/ui-egui/src/configuration_rules_ui.rs index e88ec8379..f3c136122 100644 --- a/crates/ui-egui/src/configuration_rules_ui.rs +++ b/crates/ui-egui/src/configuration_rules_ui.rs @@ -1,5 +1,6 @@ //! Structured configuration rule editing and non-mutating row preview. use crate::SolveApp; +use crate::fonts::RichTextExt as _; use egui::{RichText, Ui}; use serde_json::{Value, json}; use solidcraft_engine::doc::config::{Column, ConfigRule, RuleCondition, RuleEffect, RuleOperator}; @@ -58,7 +59,7 @@ pub(super) fn show(ui: &mut Ui, app: &mut SolveApp, error: &mut Option, let suppression_features: Vec<(u64, String)> = features.iter().filter(|(id, _)| app.session.doc.configs.columns.contains(&Column::Suppress(*id))).cloned().collect(); ui.separator(); - ui.label(RichText::new(crate::i18n::tr_label("Configuration rules")).strong()); + ui.label(RichText::new(crate::i18n::tr_label("Configuration rules")).semibold().color(crate::theme::Tokens::get().text)); ui.add(egui::Label::new("Rules run from top to bottom. Matched drives change effective values.").wrap()); ui.add(egui::Label::new("Matched restrictions check the final values.").wrap()); for (index, rule) in rules.iter().enumerate() { diff --git a/crates/ui-egui/src/context_menu.rs b/crates/ui-egui/src/context_menu.rs index cd6bcc6fa..702889563 100644 --- a/crates/ui-egui/src/context_menu.rs +++ b/crates/ui-egui/src/context_menu.rs @@ -11,6 +11,7 @@ //! state; [`items`] lists them and [`run_item`] runs one, so the control channel (`ui.menu`, //! `ui.menuPick`) and tests reach everything a click does. +use crate::fonts::RichTextExt as _; use egui::{Align2, Color32, FontId, Pos2, Rect, Sense, Stroke, Vec2, pos2, vec2}; use serde::Serialize; use serde_json::{Value, json}; @@ -425,7 +426,7 @@ fn viewport_items(app: &SolveApp) -> Vec { } // Everything under the cursor, for what lies beneath something else. if app.menu.over_geometry { - v.push(act("ui.selectOther", "Select Other…", "").key("Hold click")); + v.push(act("ui.selectOther", "Select Other…", "select").key("Hold click")); v.push(Item::sep()); } if app.session.active_sketch.is_some() { @@ -457,7 +458,7 @@ fn viewport_items(app: &SolveApp) -> Vec { v.push(cmd(app, "solid.extrude", "Extrude")); v.push(cmd(app, "construct.plane.offset", "Offset Plane")); v.push(cmd(app, "solid.shell", "Shell")); - v.push(act("ui.editFeature", "Edit Feature", "").with(json!({ "feature": feature })).on(feature.is_some())); + v.push(act("ui.editFeature", "Edit Feature", "edit").with(json!({ "feature": feature })).on(feature.is_some())); v.push(act("ui.editSketch", "Edit Profile Sketch", "sketch").with(json!({ "sketch": sketch })).on(sketch.is_some())); v.push(Item::sep()); v.push(act("ui.appearance", "Appearance", "appearance").key("A")); @@ -467,8 +468,8 @@ fn viewport_items(app: &SolveApp) -> Vec { v.push(act("ui.delete", "Delete", "delete").key("Del")); v.push(act(if hidden { "ui.show" } else { "ui.hide" }, "Show/Hide", "eye").key("V").with(json!({ "bodies": [face] }))); v.push(Item::sep()); - v.push(act("ui.findBrowser", "Find in Browser", "").with(json!({ "body": face, "feature": feature })).on(feature.is_some())); - v.push(act("ui.findTimeline", "Find in Timeline", "").with(json!({ "feature": feature })).on(feature.is_some())); + v.push(act("ui.findBrowser", "Find in Browser", "list").with(json!({ "body": face, "feature": feature })).on(feature.is_some())); + v.push(act("ui.findTimeline", "Find in Timeline", "rollback").with(json!({ "feature": feature })).on(feature.is_some())); v.push(Item::sep()); v.push(cmd(app, "solid.press_pull", "Press Pull")); v.push(cmd(app, "inspect.measure", "Measure")); @@ -481,10 +482,10 @@ fn viewport_items(app: &SolveApp) -> Vec { v.push(act("ui.delete", "Delete", "delete").key("Del")); v.push(act(if hidden { "ui.show" } else { "ui.hide" }, "Show/Hide", "eye").key("V").with(json!({ "bodies": [body] }))); v.push(Item::sep()); - v.push(act("ui.findBrowser", "Find in Browser", "").with(json!({ "body": body }))); + v.push(act("ui.findBrowser", "Find in Browser", "list").with(json!({ "body": body }))); v.push(act("ui.saveMesh", "Save As Mesh", "export").with(json!({ "bodies": [body] }))); v.push(Item::sep()); - v.push(act("ui.tangentChain", "Select Tangent Chain", "")); + v.push(act("ui.tangentChain", "Select Tangent Chain", "chain")); v.push(cmd(app, "inspect.measure", "Measure")); } else if has(|s| matches!(s, Sel::Body { .. })) { v.extend(body_items(app, &sel_bodies(app), false)); @@ -507,7 +508,7 @@ fn viewport_items(app: &SolveApp) -> Vec { || !app.session.visibility.hidden_sketches.is_empty() || !app.session.visibility.hidden_folders.is_empty(); v.push(act("ui.showAll", "Show All", "eye").on(anything_hidden)); - v.push(act("ui.showAll", "Unisolate", "").on(!app.session.visibility.hidden_bodies.is_empty())); + v.push(act("ui.showAll", "Unisolate", "eye").on(!app.session.visibility.hidden_bodies.is_empty())); v.push(Item::sep()); v.push(cmd(app, "solid.extrude", "Extrude")); v.push(cmd(app, "solid.fillet", "Fillet")); @@ -528,7 +529,7 @@ fn viewport_items(app: &SolveApp) -> Vec { v.push(cmd(app, "parts.resize", "Change Part Size").with(json!({"component":component}))); } v.push(Item::sep()); - v.push(act("ui.clear", "Clear Selection", "").key("Esc")); + v.push(act("ui.clear", "Clear Selection", "close").key("Esc")); } v } @@ -543,7 +544,7 @@ fn body_items(app: &SolveApp, bodies: &[String], browser: bool) -> Vec { act("ui.moveBodies", "Move/Copy", "move").key("M").with(json!({ "bodies": names })).on(!locked), cmd(app, "component.from_bodies", "Create Components from Bodies").with(json!({ "bodies": names })), Item::sep(), - act("ui.material", "Physical Material", "").with(json!({ "bodies": names })), + act("ui.material", "Physical Material", "material").with(json!({ "bodies": names })), act("ui.appearance", "Appearance", "appearance").key("A").with(json!({ "bodies": names })), act("ui.properties", "Properties", "measure").with(json!({ "bodies": names })), Item::sep(), @@ -552,11 +553,11 @@ fn body_items(app: &SolveApp, bodies: &[String], browser: bool) -> Vec { Item::sep(), act("ui.delete", "Delete", "delete").key("Del").with(json!({ "items": items })).on(!locked), cmd(app, "solid.remove", "Remove").with(json!({ "bodies": names })).on(!locked), - act("ui.rename", "Rename", "").with(json!({ "body": bodies.first() })).on(one), + act("ui.rename", "Rename", "rename").with(json!({ "body": bodies.first() })).on(one), Item::sep(), act(if all_hidden { "ui.show" } else { "ui.hide" }, "Show/Hide", "eye").key("V").with(json!({ "bodies": names })), - act("ui.lock", if locked { "Unlock" } else { "Lock" }, "").with(json!({ "bodies": names })), - act("ui.isolate", "Isolate", "").with(json!({ "bodies": names })), + act("ui.lock", if locked { "Unlock" } else { "Lock" }, "ground").with(json!({ "bodies": names })), + act("ui.isolate", "Isolate", "body").with(json!({ "bodies": names })), ]; if one { let b = bodies.first().cloned().unwrap_or_default(); @@ -565,9 +566,9 @@ fn body_items(app: &SolveApp, bodies: &[String], browser: bool) -> Vec { } v.push(Item::sep()); if !browser { - v.push(act("ui.findBrowser", "Find in Browser", "").with(json!({ "body": b }))); + v.push(act("ui.findBrowser", "Find in Browser", "list").with(json!({ "body": b }))); } - v.push(act("ui.findTimeline", "Find in Timeline", "").with(json!({ "body": b }))); + v.push(act("ui.findTimeline", "Find in Timeline", "rollback").with(json!({ "body": b }))); } v } @@ -586,14 +587,14 @@ fn sketch_items(app: &SolveApp, id: u64) -> Vec { act("ui.exportDxf", "Export DXF…", "export").with(json!({ "sketch": id })), Item::sep(), act("ui.delete", "Delete", "delete").key("Del").with(json!({ "items": [{"type": "feature", "id": id}] })), - act("ui.rename", "Rename", "").with(json!({ "feature": id })), + act("ui.rename", "Rename", "rename").with(json!({ "feature": id })), Item::sep(), - act("ui.lookAt", "Look At", "").with(json!({ "sketch": id })), - act("ui.sketchProfile", if profiles { "Hide Profile" } else { "Show Profile" }, "").with(json!({ "sketch": id })), + act("ui.lookAt", "Look At", "lookat").with(json!({ "sketch": id })), + act("ui.sketchProfile", if profiles { "Hide Profile" } else { "Show Profile" }, "sketch").with(json!({ "sketch": id })), act("ui.sketchDims", if dims { "Hide Dimension" } else { "Show Dimension" }, "dimension").with(json!({ "sketch": id })), act(if visible { "ui.hideSketch" } else { "ui.showSketch" }, "Show/Hide", "eye").key("V").with(json!({ "sketch": id })), Item::sep(), - act("ui.findTimeline", "Find in Timeline", "").with(json!({ "feature": id })), + act("ui.findTimeline", "Find in Timeline", "rollback").with(json!({ "feature": id })), ] } @@ -607,11 +608,11 @@ fn plane_items(app: &SolveApp, id: u64) -> Vec { act("ui.editFeature", "Edit Feature", "plane").with(json!({ "feature": id })), Item::sep(), act("ui.delete", "Delete", "delete").key("Del").with(json!({ "items": [{"type": "feature", "id": id}] })), - act("ui.rename", "Rename", "").with(json!({ "feature": id })), + act("ui.rename", "Rename", "rename").with(json!({ "feature": id })), Item::sep(), act("ui.originPart", "Show/Hide", "eye").key("V").with(json!({ "keys": [f.name], "show": !visible })), Item::sep(), - act("ui.findTimeline", "Find in Timeline", "").with(json!({ "feature": id })), + act("ui.findTimeline", "Find in Timeline", "rollback").with(json!({ "feature": id })), ] } @@ -637,14 +638,14 @@ fn joint_items(app: &SolveApp, id: u64) -> Vec { let hidden = !joints.iter().any(|j| app.session.joint_visible(*j)); vec![ act("ui.editJoint", "Edit Joint", "joint").with(json!({ "joint": id })), - act("ui.editJoint", "Edit Joint Limits", "").with(json!({ "joint": id })).on(!rigid), - act("ui.driveJoint", "Drive Joint", "").with(json!({ "joint": id })).on(!rigid), - act("ui.animateJoint", "Animate Joint", "").with(json!({ "joint": id })).on(!rigid && !j.suppressed), - act("ui.findJoint", "Find in Window", "").with(json!({ "joint": id })), + act("ui.editJoint", "Edit Joint Limits", "joint").with(json!({ "joint": id })).on(!rigid), + act("ui.driveJoint", "Drive Joint", "drive").with(json!({ "joint": id })).on(!rigid), + act("ui.animateJoint", "Animate Joint", "play").with(json!({ "joint": id })).on(!rigid && !j.suppressed), + act("ui.findJoint", "Find in Window", "fit").with(json!({ "joint": id })), cmd(app, "joint.edit", if j.suppressed { "Unsuppress" } else { "Suppress" }).with(json!({ "joint": id, "suppressed": !j.suppressed })), Item::sep(), act("ui.delete", "Delete", "delete").key("Del").with(json!({ "joints": [id] })), - act("ui.rename", "Rename", "").with(json!({ "joint": id })), + act("ui.rename", "Rename", "rename").with(json!({ "joint": id })), Item::sep(), // Hiding a joint hides only its glyph: it still constrains and moves the parts. act("browser.visibility", "Show/Hide", "eye").key("V").with(json!({ "joints": joints, "visible": hidden })), @@ -733,12 +734,12 @@ fn component_items(app: &SolveApp, id: u64) -> Vec { } v.push(cmd(app, "component.create", "New Component").with(json!({ "parent": id }))); if id == 0 { - v.push(act("ui.copyDesign", "Copy", "").key("Ctrl+C")); - v.push(act("ui.paste", "Paste", "").key("Ctrl+V").on(crate::edit_clipboard::can_paste(app))); + v.push(act("ui.copyDesign", "Copy", "copy").key("Ctrl+C")); + v.push(act("ui.paste", "Paste", "paste").key("Ctrl+V").on(crate::edit_clipboard::can_paste(app))); v.push(cmd(app, "component.from_bodies", "Create Components from Bodies").with(json!({ "bodies": names })).on(!bodies.is_empty())); } v.push(Item::sep()); - v.push(act("ui.material", "Physical Material", "").with(json!({ "bodies": names })).on(!bodies.is_empty())); + v.push(act("ui.material", "Physical Material", "material").with(json!({ "bodies": names })).on(!bodies.is_empty())); v.push( act("ui.appearance", "Appearance", "appearance") .key("A") @@ -761,11 +762,11 @@ fn component_items(app: &SolveApp, id: u64) -> Vec { v.push(cmd(app, "component.paste_new", "Paste New").with(json!({ "component": id, "translate": [10, 10, 0] }))); v.push(act("ui.delete", "Delete", "delete").key("Del").with(json!({ "occurrences": [occ.map(|o| o.id)] })).on(occ.is_some())); } - v.push(act("ui.rename", "Rename", "").with(json!({ "component": id }))); + v.push(act("ui.rename", "Rename", "rename").with(json!({ "component": id }))); v.push(Item::sep()); v.push(act(if hidden { "ui.show" } else { "ui.hide" }, "Show/Hide", "eye").key("V").with(json!({ "bodies": names })).on(!bodies.is_empty())); v.push(act("ui.showAll", "Show All Bodies", "eye")); - v.push(act("ui.isolate", "Isolate", "").with(json!({ "bodies": names })).on(!bodies.is_empty() && id != 0)); + v.push(act("ui.isolate", "Isolate", "body").with(json!({ "bodies": names })).on(!bodies.is_empty() && id != 0)); v.push(act("ui.newGroup", "New Group", "folder").with(json!({ "component": id }))); v } @@ -819,7 +820,7 @@ fn sketch_entity_items(app: &SolveApp) -> Vec { v.push(cmd(app, "sketch.circle.center", "Circle")); v.push(cmd(app, "sketch.dimension", "Sketch Dimension")); v.push(Item::sep()); - v.push(act("ui.paste", "Paste", "").key("Ctrl+V").on(app.session.sketch_clipboard.is_some())); + v.push(act("ui.paste", "Paste", "paste").key("Ctrl+V").on(app.session.sketch_clipboard.is_some())); return v; } let ents: Vec = curves.iter().chain(points.iter()).cloned().collect(); @@ -835,9 +836,9 @@ fn sketch_entity_items(app: &SolveApp) -> Vec { v.extend(explode_text(app)); } v.push(cmd(app, "sketch.move", "Move/Copy").key("M")); - v.push(act("ui.cut", "Cut", "").key("Ctrl+X")); - v.push(act("ui.copy", "Copy", "").key("Ctrl+C")); - v.push(act("ui.paste", "Paste", "").key("Ctrl+V").on(app.session.sketch_clipboard.is_some())); + v.push(act("ui.cut", "Cut", "cut").key("Ctrl+X")); + v.push(act("ui.copy", "Copy", "copy").key("Ctrl+C")); + v.push(act("ui.paste", "Paste", "paste").key("Ctrl+V").on(app.session.sketch_clipboard.is_some())); if !curves.is_empty() { v.push(cmd(app, "sketch.construction", "Normal / Construction").with(json!({ "curves": curves }))); } @@ -1482,12 +1483,23 @@ pub fn describe(app: &SolveApp) -> Value { return json!({ "open": false, "pending": app.menu.pending.is_some() }); }; let radial = if app.menu.radial { radial_items(app) } else { Vec::new() }; + let describe_items = |items: Vec| { + items + .into_iter() + .map(|item| { + let placeholder = !item.icon.is_empty() && crate::icon_svg::resolve(&item.icon).placeholder; + let mut value = json!(item); + value["placeholder"] = json!(placeholder); + value + }) + .collect::>() + }; json!({ "open": true, "at": [at.x, at.y], "target": app.menu.target, - "radial": radial, - "items": items(app, &app.menu.target), + "radial": describe_items(radial), + "items": describe_items(items(app, &app.menu.target)), "rename": app.menu.rename.as_ref().map(|r| r.text.clone()), }) } @@ -1683,7 +1695,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { let resp = crate::frame::area(egui::Id::new("sc_marking_menu")).fixed_pos(area.min).order(egui::Order::Foreground).show(ctx, |ui| { let (r, _) = ui.allocate_exact_size(area.size(), Sense::hover()); let painter = ui.painter_at(r.expand(4.0)); - let font = FontId::proportional(13.0); + let font = FontId::proportional(crate::theme::Tokens::get().font_button); // Centre: a ring with a pointer toward the hot direction. let direction = hot.zip(pointer).map(|(k, p)| ((p - c).normalized(), radial.get(k).is_some_and(|i| i.enabled))); crate::icons::glyphs::radial_centre(&painter, c, direction, t); @@ -1782,7 +1794,12 @@ fn workspace_menu(ui: &mut egui::Ui, items: &[Item], key_row: Option, hei ui.set_width(450.0); ui.spacing_mut().item_spacing.y = 0.0; ui.add_space(4.0); - ui.label(egui::RichText::new(crate::i18n::tr("ui.ribbon_workspace").to_uppercase()).size(11.0).strong().color(t.text_dim)); + ui.label( + egui::RichText::new(crate::i18n::tr("ui.ribbon_workspace").to_uppercase()) + .size(crate::theme::Tokens::get().font_small) + .semibold() + .color(t.text_dim), + ); ui.add_space(8.0); egui::ScrollArea::vertical().id_salt("workspace_menu_rows").max_height((height - 116.0).max(60.0)).show(ui, |ui| { for (k, item) in items.iter().enumerate() { @@ -1824,16 +1841,13 @@ fn workspace_menu(ui: &mut egui::Ui, items: &[Item], key_row: Option, hei let name = crate::i18n::tr_label(&item.label); let x = r.left() + 74.0; let y = r.top() + 17.0; - let galley = egui::WidgetText::from(egui::RichText::new(name).strong().size(14.0).color(text)).into_galley( - ui, - Some(egui::TextWrapMode::Extend), - f32::INFINITY, - egui::TextStyle::Button, - ); + let galley = egui::WidgetText::from(egui::RichText::new(name).semibold().size(crate::theme::Tokens::get().font_heading).color(text)) + .into_galley(ui, Some(egui::TextWrapMode::Extend), f32::INFINITY, egui::TextStyle::Button); let badge_x = x + galley.size().x + 9.0; let origin = pos2(x, y - galley.size().y / 2.0); - ui.painter().galley(origin - vec2(0.2, 0.0), galley.clone(), text); - ui.painter().galley(origin + vec2(0.2, 0.0), galley, text); + let ppp = ui.ctx().pixels_per_point().max(0.5); + let origin = pos2((origin.x * ppp).round() / ppp, (origin.y * ppp).round() / ppp); + ui.painter().galley(origin, galley, text); let badge = crate::i18n::tr(if planned { "ui.workspace_planned" } else if current { @@ -1841,24 +1855,28 @@ fn workspace_menu(ui: &mut egui::Ui, items: &[Item], key_row: Option, hei } else { "ui.workspace_available" }); - let badge = ui.painter().layout_no_wrap(badge.to_string(), FontId::proportional(11.0), if current { t.on_accent } else { accent }); + let badge = ui.painter().layout_no_wrap( + badge.to_string(), + FontId::proportional(crate::theme::Tokens::get().font_small), + if current { t.on_accent } else { accent }, + ); let badge_rect = Rect::from_min_size(pos2(badge_x, y - 8.0), badge.size() + vec2(12.0, 3.0)); ui.painter().rect_filled(badge_rect, 8.0, if current { accent } else { soft }); ui.painter().galley(badge_rect.min + vec2(6.0, 1.5), badge, accent); - let line = |label: &str, y: f32| { - let mut job = egui::text::LayoutJob::simple_singleline(label.to_string(), FontId::proportional(12.0), text); + let line = |content: String, y: f32| { + let mut job = + egui::text::LayoutJob::simple_singleline(content, FontId::proportional(crate::theme::Tokens::get().font_body), text); job.wrap.max_width = r.right() - x - 6.0; job.wrap.max_rows = 1; job.wrap.break_anywhere = false; let galley = ui.painter().layout_job(job); ui.painter().galley(pos2(x, y), galley, text); }; - line(crate::i18n::tr(description), r.top() + 29.0); + line(crate::i18n::tr(description).to_string(), r.top() + 29.0); if let Some(tabs) = tabs { - // Reuse existing tab-name translations when a partial catalog falls back - // to the English summary; complete catalogs keep their translated summary. + // Translate each tab even when this composed message falls back to English. let labels = crate::i18n::tr(tabs).split('·').map(|label| crate::i18n::tr_label(label.trim())).collect::>().join(" · "); - line(&labels, r.top() + 47.0); + line(labels, r.top() + 47.0); } resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, item.enabled, name)); if resp.clicked() && item.enabled { @@ -1869,7 +1887,12 @@ fn workspace_menu(ui: &mut egui::Ui, items: &[Item], key_row: Option, hei ui.add_space(6.0); ui.separator(); ui.add_space(6.0); - ui.add(egui::Label::new(egui::RichText::new(crate::i18n::tr("ui.workspace_footer")).size(11.0).color(t.text_dim)).wrap()); + ui.add( + egui::Label::new( + egui::RichText::new(crate::i18n::tr("ui.workspace_footer")).size(crate::theme::Tokens::get().font_small).color(t.text_dim), + ) + .wrap(), + ); ui.add_space(4.0); }); picked @@ -1897,6 +1920,27 @@ pub fn menu_frame(ui: &mut egui::Ui, add: impl FnOnce(&mut egui::Ui) -> R) -> .inner } +/// A compact menu button with an explicit semantic icon, for native egui popup menus. +pub fn button(ui: &mut egui::Ui, label: &str, icon: &str) -> egui::Response { + button_enabled(ui, label, icon, true) +} + +/// The disabled form keeps its icon visible and dims it with the menu row. +pub fn button_enabled(ui: &mut egui::Ui, label: &str, icon: &str, enabled: bool) -> egui::Response { + let response = ui + .add_enabled_ui(enabled, |ui| { + let icon_id = ui.id().with(("menu_icon", label)); + let row = egui::Button::new((egui::Atom::custom(icon_id, vec2(16.0, 16.0)), label)).min_size(vec2(180.0, 22.0)).atom_ui(ui); + if let Some(rect) = row.rect(icon_id) { + icons::paint_icon(ui.painter(), rect, icon, if enabled { 1.0 } else { 0.35 }); + } + row.response + }) + .inner; + crate::scenario::publish_handle(&format!("menu:{label}"), response.rect.center()); + response +} + /// One list row; the item when it was clicked. pub fn list_row(ui: &mut egui::Ui, item: &Item) -> Option { list_row_lit(ui, item, false) @@ -1912,7 +1956,12 @@ pub fn list_row_lit(ui: &mut egui::Ui, item: &Item, lit: bool) -> Option { return None; } if item.is_heading() { - let text = ui.painter().layout(crate::i18n::tr_label(&item.label).to_uppercase(), FontId::proportional(10.5), t.text_dim, w - 16.0); + let text = ui.painter().layout( + crate::i18n::tr_label(&item.label).to_uppercase(), + FontId::proportional(crate::theme::Tokens::get().font_panel), + t.text_dim, + w - 16.0, + ); let (r, _) = ui.allocate_exact_size(vec2(w, (text.size().y + 8.0).max(20.0)), Sense::hover()); ui.painter().galley(pos2(r.left() + 8.0, r.top() + 4.0), text, t.text_dim); return None; @@ -1935,10 +1984,23 @@ pub fn list_row_lit(ui: &mut egui::Ui, item: &Item, lit: bool) -> Option { } let text = if item.enabled { t.text } else { t.text_dim.gamma_multiply(0.75) }; let display_label = crate::i18n::tr_label(&item.label); - ui.painter().text(pos2(r.left() + 32.0, r.center().y), Align2::LEFT_CENTER, display_label, FontId::proportional(13.0), text); + resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, item.enabled, display_label)); + ui.painter().text( + pos2(r.left() + 32.0, r.center().y), + Align2::LEFT_CENTER, + display_label, + FontId::proportional(crate::theme::Tokens::get().font_button), + text, + ); if !item.shortcut.is_empty() { let display_shortcut = crate::i18n::tr_label(&item.shortcut); - ui.painter().text(pos2(r.right() - 10.0, r.center().y), Align2::RIGHT_CENTER, display_shortcut, FontId::proportional(11.5), t.text_dim); + ui.painter().text( + pos2(r.right() - 10.0, r.center().y), + Align2::RIGHT_CENTER, + display_shortcut, + FontId::proportional(crate::theme::Tokens::get().font_caption), + t.text_dim, + ); } (item.enabled && resp.clicked()).then(|| item.clone()) } @@ -1955,7 +2017,7 @@ fn show_rename(app: &mut SolveApp, ctx: &egui::Context) { let resp = crate::frame::area(egui::Id::new("sc_rename")).fixed_pos(r.at).constrain(true).order(egui::Order::Foreground).show(ctx, |ui| { menu_frame(ui, |ui| { ui.add_space(2.0); - ui.label(egui::RichText::new(crate::i18n::tr_label("Rename")).size(11.0).color(t.text_dim)); + ui.label(egui::RichText::new(crate::i18n::tr_label("Rename")).size(crate::theme::Tokens::get().font_small).color(t.text_dim)); let te = ui.add(egui::TextEdit::singleline(&mut r.text).desired_width(200.0).id(egui::Id::new("sc_rename_text"))); if !r.focused { // Start with the whole name selected, ready to type over. @@ -2085,7 +2147,7 @@ mod tests { #[test] fn disabled_radial_menu_does_not_capture_right_button_hold() { let mut app = SolveApp::new(solidcraft_engine::Session::default(), Default::default()); - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); let point = pos2(600.0, 400.0); app.viewport.mouse = Some(point); for (time, events) in [ @@ -2165,6 +2227,27 @@ mod workspace_menu_tests { use super::*; use crate::scenario::{Harness, rect_of}; + #[test] + fn workspace_titles_use_one_semibold_text_run() { + let ctx = crate::fonts::test_context(); + let app = SolveApp::new(Default::default(), Default::default()); + let list = items(&app, &Target::Workspace); + let mut output = ctx.run_ui(egui::RawInput::default(), |ui| { + workspace_menu(ui, &list, None, 1000.0); + }); + output.textures_delta.clear(); + let titles: Vec<_> = output + .shapes + .iter() + .filter_map(|s| match &s.shape { + egui::Shape::Text(text) if text.galley.text() == "Design" => Some(text), + _ => None, + }) + .collect(); + assert_eq!(titles.len(), 1, "workspace titles must never be drawn twice"); + assert_eq!(titles[0].galley.job.sections[0].format.font_id, crate::fonts::semibold(14.0)); + } + #[test] fn workspace_rows_keep_switching_handles_and_disabled_render_behavior() { let mut h = Harness::new(); diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index f33db5648..fca297c44 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -24,6 +24,7 @@ //! headless CPU render of the model with the current camera, in the window's theme, with the //! section the viewport shows (no window needed); the ground grid and the origin's axes as the //! window shows them, unless `grid` or `axes` says +//! - `ui.icon_audit {reset?, stop?}`: collect/drain requested icon names, resolved masters and placeholder flags; //! - `ui.menu {x?, y?, target?, close?}`: open a context menu at a point (the viewport's marking //! menu, or a browser menu with `target: {type: body|sketch|component, …}`); without a point, //! the open menu and its items. `ui.menuPick {item}` runs an item by id or label; @@ -668,6 +669,16 @@ fn dispatch(app: &mut SolveApp, ctx: &egui::Context, method: &str, p: &Value) -> app.synthetic.push(egui::Event::Text(s("text").unwrap_or("").to_string())); ok(Value::Null) } + "ui.icon_audit" => { + if b("reset") { + crate::icon_svg::audit::start(); + } + let requested = crate::icon_svg::audit::take(); + if b("stop") { + crate::icon_svg::audit::stop(); + } + ok(json!({"requested": requested})) + } "ui.menu" => { if b("close") { crate::context_menu::close(app); @@ -957,7 +968,7 @@ mod tests { #[test] fn touchpad_text_prefix_does_not_collapse_queued_pointer_frames() { let mut app = SolveApp::new(Session::default(), Services::default()); - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); let (req, _) = ControlRequest::new("ui.text", json!({"text":"prefix"})); assert!(matches!(handle(&mut app, &ctx, &req), Outcome::Done(_))); for params in [json!({"x":10,"y":10,"shift":true}), json!({"x":20,"y":20,"alt":true}), json!({"x":30,"y":30})] { @@ -981,7 +992,7 @@ mod tests { #[test] fn touchpad_automation_preserves_each_queued_moves_modifiers() { let mut app = SolveApp::new(Session::default(), Services::default()); - let ctx = egui::Context::default(); + let ctx = crate::fonts::test_context(); for params in [json!({"x":10,"y":10,"shift":true}), json!({"x":20,"y":20,"alt":true}), json!({"x":30,"y":30})] { let (req, _) = ControlRequest::new("ui.move", params); assert!(matches!(handle(&mut app, &ctx, &req), Outcome::Done(_))); @@ -1003,7 +1014,7 @@ mod tests { fn render(app: &mut SolveApp, path: &std::path::Path) -> Vec { let (req, _rx) = ControlRequest::new("ui.render", json!({"path": path.to_string_lossy(), "width": 200, "height": 140})); - match handle(app, &egui::Context::default(), &req) { + match handle(app, &crate::fonts::test_context(), &req) { Outcome::Done(v) => assert_eq!(v["ok"], true, "{v}"), Outcome::Screenshot { .. } => panic!("ui.render took a screenshot"), } @@ -1073,7 +1084,7 @@ mod tests { params[k.as_str()] = v.clone(); } let (req, _rx) = ControlRequest::new("ui.render", params); - match handle(app, &egui::Context::default(), &req) { + match handle(app, &crate::fonts::test_context(), &req) { Outcome::Done(v) => assert_eq!(v["ok"], true, "{v}"), Outcome::Screenshot { .. } => panic!("ui.render took a screenshot"), } @@ -1348,7 +1359,7 @@ mod tests { params["allow_paths"] = json!([root.to_string_lossy()]); } let (req, _rx) = ControlRequest::new(method, params); - match handle(&mut app, &egui::Context::default(), &req) { + match handle(&mut app, &crate::fonts::test_context(), &req) { Outcome::Done(v) => v, Outcome::Screenshot { path } => json!({"ok": true, "screenshot": path}), } diff --git a/crates/ui-egui/src/crash_ui.rs b/crates/ui-egui/src/crash_ui.rs index b1194c35b..75412fefd 100644 --- a/crates/ui-egui/src/crash_ui.rs +++ b/crates/ui-egui/src/crash_ui.rs @@ -1,6 +1,7 @@ //! The Crash Reports window (Help > Crash Reports…): the reports `solidcraft_engine::crash` //! keeps on this computer, each with a reviewed issue draft. It opens by itself after a crash. +use crate::fonts::RichTextExt as _; use egui::{RichText, vec2}; use solidcraft_engine::crash::{self, Summary}; @@ -88,7 +89,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { if ui.small_button("Copy folder path").clicked() { ctx.copy_text(d.clone()); } - ui.add(egui::Label::new(RichText::new(&d).monospace().size(11.0)).truncate()).on_hover_text(&d); + ui.add(egui::Label::new(RichText::new(&d).monospace().size(crate::theme::Tokens::get().font_small)).truncate()).on_hover_text(&d); }); } ui.separator(); @@ -98,14 +99,14 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { egui::ScrollArea::vertical().max_height(320.0).show(ui, |ui| { for r in &app.crashes.reports { ui.horizontal(|ui| { - ui.label(RichText::new(report_heading(r)).strong()); + ui.label(RichText::new(report_heading(r)).semibold().color(crate::theme::Tokens::get().text)); if let Some(c) = &r.command { - ui.label(RichText::new(c).monospace().size(11.0).color(t.text_dim)); + ui.label(RichText::new(c).monospace().size(crate::theme::Tokens::get().font_small).color(t.text_dim)); } }); - ui.label(RichText::new(&r.message).size(12.0)); + ui.label(RichText::new(&r.message).size(t.font_body)); if r.kind == "unclean_exit" { - ui.label(RichText::new(crate::i18n::tr("crash.unclean_explanation")).size(12.0).color(t.text_dim)); + ui.label(RichText::new(crate::i18n::tr("crash.unclean_explanation")).size(t.font_body).color(t.text_dim)); } ui.horizontal(|ui| { if ui.small_button("Report…").clicked() { @@ -118,7 +119,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { delete = Some(Some(r.id.clone())); } if r.replayable { - ui.label(RichText::new("replayable").size(11.0).color(t.text_dim)); + ui.label(RichText::new("replayable").size(crate::theme::Tokens::get().font_small).color(t.text_dim)); } }); ui.add_space(6.0); diff --git a/crates/ui-egui/src/design_properties.rs b/crates/ui-egui/src/design_properties.rs index 7a5503205..1a20dacf6 100644 --- a/crates/ui-egui/src/design_properties.rs +++ b/crates/ui-egui/src/design_properties.rs @@ -5,6 +5,7 @@ //! Document Settings, the root component's menu and `ui.start` of `document.metadata` or //! `document.metadata.set` open it. +use crate::fonts::RichTextExt as _; use egui::RichText; use serde_json::{Map, Value}; use solidcraft_engine::doc::metadata::{DESCRIPTION, WELL_KNOWN}; @@ -89,7 +90,10 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { let mut open = true; let (mut ok, mut cancel) = (false, false); let metadata = app.session.doc.metadata.clone(); - let title = RichText::new(crate::i18n::tr_label("Design Properties")).strong().size(13.0); + let title = RichText::new(crate::i18n::tr_label("Design Properties")) + .semibold() + .color(crate::theme::Tokens::get().text) + .size(crate::theme::Tokens::get().font_button); crate::frame::window(ctx, title, crate::frame::Width::Normal) .id(egui::Id::new("sc_design_properties")) .open(&mut open) @@ -123,7 +127,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) { ui.label(RichText::new(crate::i18n::tr("ui.design_properties.others_note")).small().color(t.text_dim)); egui::ScrollArea::vertical().max_height(160.0).show(ui, |ui| { for (k, v) in others { - ui.label(RichText::new(k).monospace().size(12.0).color(t.text)); + ui.label(RichText::new(k).monospace().size(crate::theme::Tokens::get().font_body).color(t.text)); ui.label(RichText::new(preview(v)).monospace().small().color(t.text_dim)); } }); diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 5a06ffd63..2b5ce075b 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -2,6 +2,7 @@ //! inputs (geometry picked in the viewport, never typed), then runs its command; it never //! changes the design itself. Things selected before the command starts become its input. +use crate::fonts::RichTextExt as _; use std::hash::{Hash, Hasher}; use egui::{Color32, RichText, Stroke, vec2}; @@ -18,6 +19,9 @@ use crate::theme::Tokens; use crate::tool_modifiers::{Audit, Scope, ToolModifiers}; use crate::viewport::Hit; +#[path = "dialogs_dense.rs"] +mod dense; + const SELECT_ONLY: &[Scope] = &[Scope::Selection, Scope::FeaturePreview]; const SELECT_MANIP: &[Scope] = &[Scope::Selection, Scope::Manipulator, Scope::FeaturePreview]; @@ -402,6 +406,10 @@ pub struct Dialog { pub focus: bool, /// Folded to its header (the "−" glyph). pub collapsed: bool, + /// Transient display preference; never part of a command or a saved feature. + pub preview_enabled: bool, + /// Preserve Apply intent across asynchronous evaluation; never a command parameter. + repeat_after_apply: bool, /// Parameters the dialog doesn't show but the command needs (kept when editing). pub extra: serde_json::Map, /// What the inputs were when OK was refused: `error` stays only while they still are. @@ -527,6 +535,8 @@ impl Dialog { profile_selection_changed: false, focus: true, collapsed: false, + preview_enabled: true, + repeat_after_apply: false, extra: serde_json::Map::new(), refused: None, then_start: None, @@ -962,7 +972,7 @@ impl Dialog { /// Dialogs holding a table get the wide limit. pub fn is_wide(&self) -> bool { - matches!(self.kind, Kind::Params { .. } | Kind::SketchModify(crate::sketch_modify_ui::Mod::PatternRect { .. })) + matches!(self.kind, Kind::Params { .. }) || (matches!(self.kind, Kind::PatternRect { .. }) && self.inputs.first().is_some_and(|i| i.accept == selection::FEATURES)) || matches!(&self.kind, Kind::Motion(k) if k.wide()) } @@ -1542,6 +1552,9 @@ fn plane_value(s: &Session, sel: Option<&Sel>) -> Option { /// A value field; true when Enter was pressed in it. pub(crate) fn field(ui: &mut egui::Ui, s: &mut String) -> bool { + if crate::ui_kit::contains(ui) { + return crate::ui_kit::field(ui, s); + } let r = ui.text_edit_singleline(s); crate::theme::TabAccent::number_focus(ui, &r); publish_row(&r); @@ -1552,11 +1565,15 @@ pub(crate) fn field(ui: &mut egui::Ui, s: &mut String) -> bool { /// A checkbox row. Its row handle (`dialog:`) lets a scenario click it by the label /// beside it, the way `field` already publishes one for a value field. pub(crate) fn check(ui: &mut egui::Ui, on: &mut bool) { - let r = ui.checkbox(on, ""); - publish_row(&r); + let r = if crate::ui_kit::contains(ui) { crate::ui_kit::checkbox(ui, "", on) } else { ui.checkbox(on, "") }; + publish_check(ui, &r, *on); } pub(crate) fn combo(ui: &mut egui::Ui, id: &str, labels: &[&str], sel: &mut usize) { + if crate::ui_kit::contains(ui) { + crate::ui_kit::dropdown(ui, id, sel, labels); + return; + } let row = ROW.with(|r| r.borrow().clone()); let selected = labels.get(*sel).copied().map(tr).unwrap_or(""); let r = egui::ComboBox::from_id_salt(id).selected_text(selected).width(FIELD_W).show_ui(ui, |ui| { @@ -1568,39 +1585,6 @@ pub(crate) fn combo(ui: &mut egui::Ui, id: &str, labels: &[&str], sel: &mut usiz publish_row(&r.response); } -/// A mode choice as a row of icon buttons rather than a drop-down: every mode is on screen at -/// once, each drawn as the shape it makes, with its name as the tooltip. `labels` and `icons` -/// run in step; a mode with no icon gets the fallback square. Publishes the handles a combo -/// does, `dialog::