From eb7e360652d727236cb422eaa9b9492a9263c402 Mon Sep 17 00:00:00 2001 From: squalorso <316661546+squalorso@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:13:00 +0100 Subject: [PATCH] #3172: doc comments on the Font dialog and the colour swatch (review) The two functions this PR touches without a doc comment get one, as CodeRabbit's docstring check asked. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/dialogs/dispatch.rs | 3 +++ crates/ui-egui/src/widgets/combo.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/crates/ui-egui/src/dialogs/dispatch.rs b/crates/ui-egui/src/dialogs/dispatch.rs index 386b8052d7..4819c1314d 100644 --- a/crates/ui-egui/src/dialogs/dispatch.rs +++ b/crates/ui-egui/src/dialogs/dispatch.rs @@ -95,6 +95,9 @@ fn rename_document_dialog(app: &mut WordApp, ui: &mut Ui, d: &mut Dialog) -> boo false } +/// Home › Font › Font… (Ctrl+D): font, size, colour (a colour field named "Font color:"), +/// spacing, kerning and the effects, with a preview. OK applies them; true when OK or Cancel +/// closes the dialog. fn font_dialog(app: &mut WordApp, ui: &mut Ui, d: &mut Dialog) -> bool { let Dialog::Font { font, diff --git a/crates/ui-egui/src/widgets/combo.rs b/crates/ui-egui/src/widgets/combo.rs index 3b229cbba8..3756257db6 100644 --- a/crates/ui-egui/src/widgets/combo.rs +++ b/crates/ui-egui/src/widgets/combo.rs @@ -39,6 +39,8 @@ pub fn color_grid(ui: &mut Ui, theme: &[wordcraft_doc::Rgb]) -> Option { picked } +/// A colour grid's square of colour `c`, outlined in the accent colour while hovered and named +/// by its hex code ("#C00000") for screen readers and its tooltip. True when it is clicked. pub(crate) fn swatch(ui: &mut Ui, c: wordcraft_doc::Rgb) -> bool { let (r, resp) = ui.allocate_exact_size(vec2(15.0, 15.0), Sense::click()); ui.painter().rect_filled(r, 0.0, Color32::from_rgb(c.0, c.1, c.2));