diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 8e6c9f562a..6b028524c1 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -18,6 +18,7 @@ next to them. | `assets/icons/{link-2,type,x}.svg` | Lucide icons derived from Feather (subset of the row above) | Cole Bemis (Feather), Lucide Contributors | via Lucide | MIT (Feather) and ISC (Lucide), [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) | | `assets/icons/vector-shape.svg` | Vector path shape-layer glyph with four anchor points | @superplay2021 | Original work for PhotoCraft | MIT OR Apache-2.0 | | `assets/icons/spirit-level.svg` | Straighten tool glyph: a spirit level with its vial and bubble under a dotted arc | PhotoCraft contributors | Original work | MIT OR Apache-2.0 | +| `assets/icons/type-vertical.svg` | Vertical Type tool glyph: Lucide `type`'s T, drawn narrower to make room for a downward arrow of our own at its left | Lucide Icons and Contributors; arrow by PhotoCraft contributors | Derived from `icons/type.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) | | `assets/icons/path-op-{new-layer,combine,subtract,intersect,exclude,merge}.svg` | Path Operations glyphs (Pen options bar): a single square for New Layer, and two overlapping squares showing the area each operation keeps (union, back minus front, overlap, everything but the overlap, the merged outline), drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 | | `assets/icons/arrange-{tile-all-vertically,tile-all-horizontally,two-up-horizontal,two-up-vertical,three-up-horizontal,three-up-vertical,three-up-stacked,four-up,six-up,consolidate-all-to-tabs}.svg` | Window › Arrange layout glyphs: a window outline split into the panes each entry lays out (columns, rows, the n-up splits, and one window with a tab row for Consolidate All to Tabs), drawn on Lucide's 24 px grid and stroke | PhotoCraft contributors | Original work | MIT OR Apache-2.0 | | `assets/icons/history-brush.svg` | History Brush tool glyph: Lucide `brush` plus counter-clockwise history rewind arrow | Lucide Icons and Contributors; arrow by PhotoCraft contributors | Derived from `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) | diff --git a/assets/icons/type-vertical.svg b/assets/icons/type-vertical.svg new file mode 100644 index 0000000000..d9f05ab416 --- /dev/null +++ b/assets/icons/type-vertical.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/crates/ui-egui/src/icon_data.rs b/crates/ui-egui/src/icon_data.rs index 020d04a1b1..f630565fb1 100644 --- a/crates/ui-egui/src/icon_data.rs +++ b/crates/ui-egui/src/icon_data.rs @@ -44,6 +44,7 @@ pub static ICONS: &[(&str, &[u8])] = &[ ("square-dashed-mouse-pointer", include_bytes!("../../../assets/icons/square-dashed-mouse-pointer.svg")), ("triangle-alert", include_bytes!("../../../assets/icons/triangle-alert.svg")), ("type", include_bytes!("../../../assets/icons/type.svg")), + ("type-vertical", include_bytes!("../../../assets/icons/type-vertical.svg")), ("vector-shape", include_bytes!("../../../assets/icons/vector-shape.svg")), ("x", include_bytes!("../../../assets/icons/x.svg")), ]; diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index a7604f3e15..caa355a149 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1118,6 +1118,8 @@ mod preferences_submenu_tests; #[cfg(test)] mod selection_move_step_tests; #[cfg(test)] +mod vertical_type_icon_tests; +#[cfg(test)] mod view_guides_submenu_tests; #[cfg(test)] diff --git a/crates/ui-egui/src/panels/tool_commands.rs b/crates/ui-egui/src/panels/tool_commands.rs index 47e4a7085a..d70707bee8 100644 --- a/crates/ui-egui/src/panels/tool_commands.rs +++ b/crates/ui-egui/src/panels/tool_commands.rs @@ -69,7 +69,7 @@ pub(crate) enum ToolCommand { PaintBucket, #[command(label = "Horizontal Type Tool", icon = "type", kind = "tool", group = "T", default = "T", alias = "tools.select.type")] Type, - #[command(label = "Vertical Type Tool", icon = "type", kind = "tool", group = "T", default = "T", alias = "tools.select.verticalType")] + #[command(label = "Vertical Type Tool", icon = "type-vertical", kind = "tool", group = "T", default = "T", alias = "tools.select.verticalType")] VerticalType, #[command(label = "Horizontal Type Mask Tool", icon = "type_mask", kind = "tool", group = "T", default = "T", alias = "tools.select.horizontalTypeMask")] HorizontalTypeMask, diff --git a/crates/ui-egui/src/vertical_type_icon_tests.rs b/crates/ui-egui/src/vertical_type_icon_tests.rs new file mode 100644 index 0000000000..b92a85a68f --- /dev/null +++ b/crates/ui-egui/src/vertical_type_icon_tests.rs @@ -0,0 +1,27 @@ +//! #12062: the Vertical Type tool has its own glyph (a T with a downward arrow), so the rail, the +//! T group's flyout and the options bar's tool preset picker tell it from the horizontal Type tool. + +use craft::ui::primitives::has_icon; + +use crate::icon_data::ICONS; +use crate::icons::{register, tool_icon}; +use crate::state::Tool; + +/// The two Type tools are different tools, so they show different glyphs: the vertical one draws the +/// T with a downward arrow, not the horizontal one's plain T. +#[test] +fn the_type_tools_show_different_glyphs() { + register(); + assert_eq!(tool_icon(Tool::Type).name(), "type", "the horizontal Type tool keeps its glyph"); + assert_eq!(tool_icon(Tool::VerticalType).name(), "type-vertical"); + assert_ne!(tool_icon(Tool::VerticalType), tool_icon(Tool::Type)); +} + +/// The vertical glyph is PhotoCraft's own asset, not a catalog name, so the app set has to carry it: +/// an unregistered name paints nothing and only logs. +#[test] +fn the_vertical_glyph_is_an_app_icon() { + register(); + assert!(has_icon(&tool_icon(Tool::VerticalType)), "the vertical glyph resolves"); + assert!(ICONS.iter().any(|&(name, _)| name == "type-vertical"), "it comes from the app's icon set"); +}