mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-15 15:22:54 +00:00
fix(ui): distinguish insert text annotation icon (#7170)
This commit is contained in:
1 parent
5f8cc76cd0
commit
1a5cf6b023
3 files changed
+12
-2
No files matched your search
@@ -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"),
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
Reference in new issue
Block a user