Lints: doc links, ungate the click event helper, api map entry for AppPaint, test allowances

This commit is contained in:
aiongg
2026-11-14 02:51:47 +00:00
parent deeb91802f
commit bb277cc3ac
8 changed files with 33 additions and 26 deletions
+1
View File
@@ -5,6 +5,7 @@
use craft_ui::testing::trial;
use serde_json::json;
#[allow(clippy::wildcard_imports, reason = "tests use most of the module under test and its helpers")]
use super::*;
const TOKEN: &str = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
+1 -1
View File
@@ -257,7 +257,7 @@ fn out_of_order_completions_keep_their_tokens() {
admit(&mut captures, 11, now).expect("admitted");
admit(&mut captures, 12, now).expect("admitted");
let (_, callbacks) = settle_and_issue(&mut captures, &ctx, now, None);
let [first, second] = <[ScreenshotCallback; 2]>::try_from(callbacks).ok().expect("two captures");
let Ok([first, second]) = <[ScreenshotCallback; 2]>::try_from(callbacks) else { panic!("two captures") };
second.complete(filled([800, 600], Color32::RED));
first.complete(filled([800, 600], Color32::BLUE));
let mut finished = captures.drain(now, Some(g), None);
+16 -16
View File
@@ -1,22 +1,22 @@
//! The page widgets, on craft-ui (feature `ui`). Every one reads the document through a small trait or plain values
//! the app passes, and reports what the user did; none owns pages.
//!
//! - [`view`]: [`PageView`] over the app's [`PageSource`]; overlays draw on its [`PlacedPage`]s.
//! - [`thumbnails`]: [`PageThumbnails`], the Pages panel and slide strip.
//! - [`access`]: the AccessKit description of the text on the pages.
//! - [`setup`]: [`PageSetupDialog`] and [`PageLayoutMenus`].
//! - [`margins`]: [`MarginHandles`] on the rulers.
//! - [`header_footer`]: [`HeaderFooterZones`].
//! - [`range`]: [`PageRangeField`] and [`PageRangeOptions`].
//! - [`text_selection`]: [`TextSelectTool`], a canvas tool over the app's [`PageTexts`].
//! - [`preview`]: [`PagePreview`].
//! - [`marks`]: [`TextFrameMarks`], hidden characters and frame extras.
//! - [`column_bar`]: [`ColumnBar`].
//! - [`reading`]: [`ReadingView`].
//! - [`list`]: [`PageList`], pages and artboards.
//! - [`sync_views`]: [`SyncedViews`].
//! - [`grid`]: [`PageGrids`], margins, columns and baseline grid.
//! - [`table`]: [`EdgePicker`], [`TableProperties`], [`TableSizePicker`], [`CellSelectionOverlay`].
//! - `view`: [`PageView`] over the app's [`PageSource`]; overlays draw on its [`PlacedPage`]s.
//! - `thumbnails`: [`PageThumbnails`], the Pages panel and slide strip.
//! - `access`: the AccessKit description of the text on the pages.
//! - `setup`: [`PageSetupDialog`] and [`PageLayoutMenus`].
//! - `margins`: [`MarginHandles`] on the rulers.
//! - `header_footer`: [`HeaderFooterZones`].
//! - `range`: [`PageRangeField`] and [`PageRangeOptions`].
//! - `text_selection`: [`TextSelectTool`], a canvas tool over the app's [`PageTexts`].
//! - `preview`: [`PagePreview`].
//! - `marks`: [`TextFrameMarks`], hidden characters and frame extras.
//! - `column_bar`: [`ColumnBar`].
//! - `reading`: [`ReadingView`].
//! - `list`: [`PageList`], pages and artboards.
//! - `sync_views`: [`SyncedViews`].
//! - `grid`: [`PageGrids`], margins, columns and baseline grid.
//! - `table`: [`EdgePicker`], [`TableProperties`], [`TableSizePicker`], [`CellSelectionOverlay`].
pub mod access;
pub mod column_bar;
+5 -5
View File
@@ -1,21 +1,21 @@
//! Photoshop's layered-TIFF conventions, observed from files Photoshop writes and reads.
//!
//! A layered TIFF is an ordinary TIFF whose IFD holds the flattened composite, plus the two tags
//! [`TAG_IMAGE_SOURCE_DATA`] ([`ImageSourceData`]) and [`TAG_IMAGE_RESOURCES`] (the image
//! `TAG_IMAGE_SOURCE_DATA` ([`ImageSourceData`]) and `TAG_IMAGE_RESOURCES` (the image
//! resources). Reading one is: decode the composite, read the two tags, and rebuild a
//! [`PsdFile`] with [`ImageSourceData::into_psd`], the composite as its merged image
//! ([`interleaved_to_planar`]). Writing one is the reverse ([`planar_to_interleaved`],
//! [`ImageSourceData::for_tiff`], [`ifd_channel_resources`]).
//! (`interleaved_to_planar`). Writing one is the reverse (`planar_to_interleaved`,
//! [`ImageSourceData::for_tiff`], `ifd_channel_resources`).
//!
//! Photoshop is strict about a few things a PSD reader would not notice:
//!
//! - `LMsk` must hold its 14-byte record: a zero-length block makes Photoshop report that the
//! layer data cannot be read.
//! - It writes an empty `Patt` first and a default `FMsk` (filter mask) last, and a set of
//! blocks on every layer ([`photoshop_layer_blocks`]).
//! blocks on every layer (`photoshop_layer_blocks`).
//! - The IFD's extra samples are paired with the channel-name resources in order, ignoring the
//! `ExtraSamples` kind. When the composite's transparency is not stored in the IFD, those
//! resources must leave it out too ([`ifd_channel_resources`]).
//! resources must leave it out too (`ifd_channel_resources`).
use crate::error::{PsdError, Result};
use crate::file::{GlobalLayerMask, PsdFile};
+1 -1
View File
@@ -2,7 +2,7 @@
//!
//! Every position in a session is an absolute sample index (`i64`) at the session sample rate.
//! This crate converts those positions to and from the five Pro Tools-style timebases
//! (Bars|Beats, Min:Secs, Timecode, Feet+Frames, Samples) through a [`TempoMap`], and computes
//! (Bars|Beats, Min:Secs, Timecode, Feet+Frames, Samples) through a `TempoMap`, and computes
//! grid lines and snapping for the Grid / Nudge values.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
+1 -1
View File
@@ -52,7 +52,7 @@ pub struct TempoMap {
elapsed: Vec<f64>,
}
/// The serialized form of [`TempoMap`], without the derived lookup table.
/// The serialized form of `TempoMap`, without the derived lookup table.
#[derive(serde::Deserialize)]
struct TempoMapData {
tempos: Vec<TempoEvent>,
@@ -25,7 +25,6 @@ pub(crate) fn pointer_moved(pos: Pos2) -> Event {
}
/// `button` going down or up at `pos` with `modifiers`.
#[cfg(feature = "testing")]
pub(crate) fn button(pos: Pos2, button: egui::PointerButton, pressed: bool, modifiers: Modifiers) -> Event {
Event::PointerButton { pos, button, pressed, modifiers }
}
+8 -1
View File
@@ -267,9 +267,16 @@ note = "`Texture(CachedTexture)`, `Paint(AppPaint<Rect>)` or `None`."
[[type]]
name = "NavigatorPaint"
old = "craft_ui::canvas::navigator::preview::NavigatorPaint"
new = ""
status = "removed"
note = "Replaced by `craft_ui::canvas::AppPaint`."
[[type]]
name = "AppPaint"
old = ""
new = "craft_ui::canvas::AppPaint"
status = "replaced"
note = "`AppPaint::new(|painter: &ContentPainterCx, rect| ..)`: the one app-paint closure of the navigator and `RasterDisplay::painted`."
note = "Replaces `NavigatorPaint`. `AppPaint::new(|painter: &ContentPainterCx, rect| ..)`: the one app-paint closure of the navigator and `RasterDisplay::painted`."
[[type]]
name = "NavigatorSettings"