Files
craft-libs/crates/pages
Martin BallandClaude Opus 5.5 738d21ba8e look-chrome: rulers paint ticks only over their extent; column lighter than margins
TextRuler::paint_ticks drops the tick rule's extra labelled step beyond each
end where the ruler is cut to an extent (a page's x range), so no ticks show
past the page. TextRuler and VerticalRuler fill the column with surface.sunken
and the margins with surface.canvas: the margins were the lighter part
(surface.sunken is #fff in ArtCraft light), the reverse of a word processor's
ruler. Trials a_ruler_cut_to_an_extent_paints_no_tick_past_it and
the_ruler_column_is_lighter_than_its_margins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:31:44 +00:00
..

craft-pages

Pages for the Craft document apps (PdfCraft, WordCraft, DeckCraft, DesignCraft, VectorCraft, GridCraft). The document, its layout and its rendering stay in each app; this crate has the geometry and the widgets around pages.

Module Feature Provides
layout Page rectangles (single, two-up with a cover, as many as fit; continuous or one row), fit width/page/height, Hide White Space, view defaults
setup Paper sizes, orientation, margins and Word's presets, the page setup a dialog edits
range "1-3, 5" page ranges and Acrobat's From/To/Subset ranges
numbering Page labels in a number style with a section start and prefix
ui ui On craft-ui: PageView, PageThumbnails, PagesAccess, PageSetupDialog and PageLayoutMenus, MarginHandles, HeaderFooterZones, PageRangeField, TextSelectionLayer, PagePreview, TextFrameMarks, ColumnBar, ReadingView, PageList, SyncedViews, PageGrids, and ui::table (EdgePicker, TableProperties, TableSizePicker, CellSelectionOverlay)
serde Serde impls of the core types

The widgets read the document through small traits (PageSource, PageTextSource, AccessDescriber) or plain values, and report what the user did as actions or edit gestures.

Page numbers use craft-text's list number styles. The spreadsheet grid is craft-table's.

Stories are #[story] functions in src/ui/*/stories.rs; they register in craft_ui::testing::stories() and the craft-ui-gallery viewer lists them by the type they show.