#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 <noreply@anthropic.com>
This commit is contained in:
squalorso
2026-10-31 12:13:00 +01:00
co-authored by Claude Opus 5.5
parent 8c73173d92
commit eb7e360652
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -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,
+2
View File
@@ -39,6 +39,8 @@ pub fn color_grid(ui: &mut Ui, theme: &[wordcraft_doc::Rgb]) -> Option<String> {
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));