Skip to content

Commit

Permalink
Add tooltip for Markdown Preview copy code button (#22057)
Browse files Browse the repository at this point in the history
  • Loading branch information
notpeter authored Dec 17, 2024
1 parent 70f82f8 commit 0511f92
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/markdown_preview/src/markdown_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ use std::{
};
use theme::{ActiveTheme, SyntaxTheme, ThemeSettings};
use ui::{
h_flex, relative, tooltip_container, v_flex, Checkbox, Clickable, Color, FluentBuilder,
IconButton, IconName, IconSize, InteractiveElement, Label, LabelCommon, LabelSize, LinkPreview,
StatefulInteractiveElement, StyledExt, StyledImage, ToggleState, ViewContext, VisibleOnHover,
VisualContext as _,
h_flex, relative, tooltip_container, v_flex, ButtonCommon, Checkbox, Clickable, Color,
FluentBuilder, IconButton, IconName, IconSize, InteractiveElement, Label, LabelCommon,
LabelSize, LinkPreview, StatefulInteractiveElement, StyledExt, StyledImage, ToggleState,
Tooltip, ViewContext, VisibleOnHover, VisualContext as _,
};
use workspace::Workspace;

Expand Down Expand Up @@ -385,6 +385,7 @@ fn render_markdown_code_block(
cx.write_to_clipboard(ClipboardItem::new_string(contents.to_string()));
}
})
.tooltip(|cx| Tooltip::text("Copy code block", cx))
.visible_on_hover("markdown-block");

cx.with_common_p(div())
Expand Down

0 comments on commit 0511f92

Please sign in to comment.