fix(ui): distinguish insert text annotation icon (#7170)

This commit is contained in:
FredApps authored and GitHub committed 2026-11-14 22:26:03 +01:00
1 parent 5f8cc76cd0
commit 1a5cf6b023
3 files changed
+12 -2

No files matched your search

+1 -1
View File
@@ -293,7 +293,7 @@ pub const COMMANDS: &[CommandSpec] = &[
c("comment.polyline", "Draw connected lines", None, None, Annotate, "spline"),
c("comment.cloud", "Draw a cloud", None, None, Annotate, "cloud"),
c("comment.callout", "Add a callout", None, None, Annotate, "message-square-quote"),
c("comment.caret", "Insert text", None, None, Annotate, "text-cursor-input"),
c("comment.caret", "Insert text", None, None, Annotate, "message-square-text"),
c("comment.replace", "Replace text", None, None, Annotate, "replace"),
c("comment.attach", "Attach a file", None, None, Annotate, "paperclip"),
c("comment.eraser", "Erase drawings", None, None, Annotate, "eraser"),
+1 -1
View File
@@ -211,7 +211,7 @@ impl CommentTool {
Self::PolyLine => "spline",
Self::Cloud => "cloud",
Self::Callout => "message-square-quote",
Self::Caret => "text-cursor-input",
Self::Caret => "message-square-text",
Self::ReplaceText => "replace",
Self::Attach => "paperclip",
Self::Eraser => "eraser",
@@ -898,3 +898,13 @@ fn comment_marker_wins_over_an_overlapping_body_for_pick_and_hover() {
super::input::describe(&hidden, &mut view);
assert!(view.cursor.resolve(&ctx, QuickTool::Select).is_none());
}
#[test]
fn insert_text_icon_is_distinct_from_edit_text_and_matches_its_command() {
let insert = CommentTool::Caret.icon();
let edit = pdfcraft_engine::commands::command("edit.edit_text").unwrap().icon;
let command = pdfcraft_engine::commands::command("comment.caret").unwrap().icon;
assert_ne!(insert, edit, "adjacent tools need distinct icons");
assert_eq!(insert, command, "the annotation toolbar and command use the same icon");
assert!(crate::widgets::icons::exists(insert));
}