mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-27 21:02:58 +00:00
#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:
co-authored by
Claude Opus 5.5
parent
8c73173d92
commit
eb7e360652
@@ -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,
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user