From 43b9cf1e050a20004a7c1cdf16644127d7bc2b13 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 06:48:27 -0500 Subject: [PATCH] Document print dialog: compact inline printer rows, caption sections, no repeated radio heading, untitled section --- crates/print/src/ui/dialog.rs | 48 +++++++++++++++---- crates/print/src/ui/panel.rs | 23 ++++++--- crates/print/tests/it/dialog.rs | 41 +++++++++++++++- .../src/patterns/form_dialogs/rows.rs | 21 +++++++- 4 files changed, 114 insertions(+), 19 deletions(-) diff --git a/crates/print/src/ui/dialog.rs b/crates/print/src/ui/dialog.rs index c955c2300..fbc52746a 100644 --- a/crates/print/src/ui/dialog.rs +++ b/crates/print/src/ui/dialog.rs @@ -7,6 +7,7 @@ use craft_behavior::{CursorIcon, EditEvent, EditEvents, Metrics, Mixed, PartKey, use craft_theme::variant::Tone; use craft_ui::buttons::Button; use craft_ui::contract::{ + LabelScheme, Access, Bind, BindMut, Common, Component, Cx, Edit as _, EditResponse, Input, MeasureCx, Name, NoValue, Outcome, PaintUi, PartsCx, Pointer as _, Props as _, Role, Scroll, Show as _, ShowContainer as _, WordSetCx as _, clicked, }; @@ -23,7 +24,7 @@ use craft_ui::runtime::env::{Env, Label}; use craft_ui::runtime::focus::{ActivateKeys, KeepKeys, KeyUse}; use craft_ui::runtime::overlay::CloseReason; use craft_ui::runtime::requests::HostAnswer; -use craft_ui::sections::{DialogRole, FooterButton, Section}; +use craft_ui::sections::{DialogRole, FooterButton, HeaderStrength, Section}; use craft_ui::style::{ComponentStyle, Corners, RuleKind, StyleColor, StyleCx, SurfaceKind, TypeRole}; use egui::load::SizedTexture; use egui::{Color32, Mesh, Pos2, Rect, Response, Shape, TextureId, Ui, Vec2, pos2, vec2}; @@ -244,12 +245,14 @@ pub struct PrintSection { folded: Option, /// The title-row buttons: the id a press files, the label and whether the button is enabled. buttons: Vec<(String, Label, bool)>, + /// The rows stand without the section's heading in a document dialog (`PrintLayout::Document`). + untitled: bool, } impl PrintSection { /// The section titled `title` with its `params` rows. pub fn new(title: impl Into