Compare commits

...

1 Commits

Author SHA1 Message Date
Richard Feldman
4e49727296 Only show Copy Code button on hover 2025-04-07 21:08:11 -04:00
2 changed files with 10 additions and 1 deletions

View File

@@ -439,6 +439,7 @@ fn render_markdown_code_block(
.icon_color(Color::Muted)
.shape(ui::IconButtonShape::Square)
.tooltip(Tooltip::text("Copy Code"))
.visible_on_hover("markdown-code-block")
.on_click({
let active_thread = active_thread.clone();
let parsed_markdown = parsed_markdown.clone();

View File

@@ -861,7 +861,15 @@ impl Element for MarkdownElement {
self.markdown.clone(),
cx,
);
el.child(div().absolute().top_1().right_1().w_5().child(codeblock))
el.child(
div()
.group("markdown-code-block")
.absolute()
.top_1()
.right_1()
.w_5()
.child(codeblock),
)
});
}