Merge #16476 into the merge queue batch

Vertical Type tool: its own glyph, a T with a downward arrow (#12062)
This commit is contained in:
David Mann committed 2026-11-29 18:27:43 +01:00
commit f028c8fc6d
6 files changed
+49 -1

No files matched your search

+1
View File
@@ -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 | <https://github.com/feathericons/feather> 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 <https://github.com/lucide-icons/lucide> `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 <https://github.com/lucide-icons/lucide> `icons/brush.svg` | ISC, [`assets/icons/LICENSE-lucide.txt`](assets/icons/LICENSE-lucide.txt) |
+17
View File
@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 6V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v1" />
<path d="M16.5 5v15" />
<path d="M14 20h5" />
<path d="M5 8v9" />
<path d="M2.5 14.5 5 17l2.5-2.5" />
</svg>

After

Width:  |  Height:  |  Size: 373 B

+1
View File
@@ -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")),
];
+2
View File
@@ -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)]
+1 -1
View File
@@ -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,
@@ -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");
}