Files
Nathan Dane a20b0b8c62 Switch sheets from the Drawing Browser (#15785) (#15976)
* claim: #13210

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Yz6dHZiXcgTgrxjVNC6hx

* Drawings: the sheet page draws the open drawing's sheet, with pan and zoom, Fit Sheet, true size at 100 % and the sheet colour (#4894)

The Drawing workspace's centre draws the sheet scene of the drawing open:
drawing_scene::extract each frame and drawing_jobs::tick for the views out
of date. Strokes, dashes, fills and glyph outlines are worked out once per
generation and zoom octave. Pan and zoom go through navigation::handle with
orbit off on the page's own camera; zoom stays within 5 % to 3200 %; 100 % is
(96/25.4) x calibration / UI zoom points per mm. Sheet colour (White, Warm,
Dark, Auto) is a screen-only preference with new paper tokens. A view's state
shows in words and shape. ui.inspect gains sheet_page and ui.view takes fit,
home and actual_size on the sheet. view.fit, view.home and view.tool run with
a drawing open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Yz6dHZiXcgTgrxjVNC6hx

* Drawings: the sheet fits the canvas the ribbon leaves, and again when the window changes size until it is moved (#4894)

Fit Sheet, the hint and the zoom card use the free canvas (shell::content_rect,
then workspace_content), so the sheet isn't framed under a floating ribbon. A
fitted sheet is fitted again when the canvas changes size, until a pan or zoom
moves it. The zoom card's rectangle stays covered while the camera reads input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Yz6dHZiXcgTgrxjVNC6hx

* Drawings: the sheet's zoom reads in whole percent, and the scaffold's sheet placeholder strings go (#4894)

The zoom card shows whole percent, or tenths below 10 %. The four messages the
sheet page left unused in drawing-workspace-ui.json (the renderer and paper
colour placeholders, "Paper colour", "Auto (Theme)") are removed from every
locale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Yz6dHZiXcgTgrxjVNC6hx

* Drawings: the sheet page follows the drawing UI design: Blueprint and Prussian Blue sheets, Needs update, a view outlined near its edge (#4894)

Follows #13159's boards sheet-colour, paper-presets, status-card, picking and layout
(D09, D17, D25, D26, D29): the sheet colour choices are Follows the theme, White,
Blueprint and Prussian Blue (Historical), with the Blueprint theme's own sheet in its
blue; the paper keeps its colour on a neutral stage that moves away from it (a white
sheet on a light theme no longer turns grey); Fit sheet puts the paper above the
navigation bar; a view waiting to be drawn again says "Needs update"; a view's
boundary shows on hover only near its edge; the paper has a very slight rounded corner
on screen; the zoom card says "Actual size" and "Fit sheet".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Yz6dHZiXcgTgrxjVNC6hx

* Show the open drawing's sheets and objects in the Browser (#15777)

* Use current viewport and pointer APIs on drawing sheets

* Switch sheets above the Drawing Browser (#15785)

* Complete Drawing translations in Arabic, Hebrew and Vietnamese

---------

Co-authored-by: Louis <louisdeleforge@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:02:01 -05:00
..

solidcraft-theme

The token contract every UI component draws with. A component reads its colours and sizes from Tokens::get() and its tab colours from TabAccent::current(ctx); with nothing set, it draws with SolidCraft's built-in dark tokens. The crate holds no data files and knows no theme-file format, so a component vendored into another app draws with that app's tokens and needs no theme files, built-in themes or icon artwork.

SolidCraft's theme system (theme files, their options, the built-in themes and the per-tab surface fades) stays in the app: it resolves Tokens and hands them to this crate.

API

Item What it is
Tokens Every colour and size the UI draws with; Tokens::light() and Tokens::dark() are SolidCraft's values, written in code
Tokens::get(), Tokens::view() The tokens to draw with now (the window's, and those drawn straight onto the 3D view)
set_dark, set_vision, set_viewport_dark, set_viewport_background, set_logo_accent The thread's theme state, which the host sets every frame
set_custom, custom, scoped_tokens, scoped_panel_tokens A host's own palette in place of the built-in one, for the thread or for a scope
ColorVision Colour vision modes: a second set of values for the colours that carry a meaning
TabAccent, AccentRamp, TabTable, TabStyle A tab's selection colours, published per egui context. The theme defines the accent ramps; the host lists its tabs in a TabTable with the ramp and icon accent of each, and installs it (install_tabs, installed_tabs) for theme files keyed by tab name
set_published, PublishedTab, Environment, Surfaces, Fade A frame's per-tab palettes, as a host's theme system resolves and fades them
apply(ctx) egui's visuals and spacing from the tokens
contrast_ratio, composite, panel_surface_fill, ... WCAG contrast checks on token pairs
icon_strokes The primary strokes the tokens share with SolidCraft's icon artwork

Licence

This crate is part of SolidCraft's brand and interface, under the SolidCraft Brand and Interface Licence (LICENSE). Use it as part of SolidCraft; using it in another program or product needs the maintainers' written permission first.