Format: Pattern fill shows a gallery of every preset with Foreground and Background colors

Format Shape's Pattern fill set 25 % in accent 1 on background 1 and
offered no way to change it, and Format Background listed 10 of the 54
presets by their XML names. Both panes now show the same editor: a
gallery of the 54 DrawingML presets drawn in the fill's own colors,
each named in words, and Foreground and Background color menus.

With a pattern fill, Format Shape no longer shows the solid-fill Color
button, which replaced the pattern with a solid fill, or the
Transparency slider, which did not change a pattern. The renderer
exports the preset list and tiles for the gallery to draw.
This commit is contained in:
dotCooCoo
2026-10-24 14:13:22 -07:00
parent 38d2ade2b7
commit 2ddd2abe67
7 changed files with 290 additions and 26 deletions
+5
View File
@@ -71,6 +71,11 @@ const TILES: &[(&str, [u8; 8])] = &[
("zigZag", [0x81, 0x42, 0x24, 0x18, 0x81, 0x42, 0x24, 0x18]),
];
/// Every preset name, in the order of the tiles.
pub fn presets() -> impl Iterator<Item = &'static str> {
TILES.iter().map(|(n, _)| *n)
}
/// The 8×8 tile of preset `name` (`pct50` for an unknown name).
pub fn tile(name: &str) -> [u8; 8] {
TILES