Add tooltip for Markdown Preview copy code button (#22057)
This commit is contained in:
parent
70f82f84c6
commit
0511f9268b
1 changed files with 5 additions and 4 deletions
|
@ -18,10 +18,10 @@ use std::{
|
||||||
};
|
};
|
||||||
use theme::{ActiveTheme, SyntaxTheme, ThemeSettings};
|
use theme::{ActiveTheme, SyntaxTheme, ThemeSettings};
|
||||||
use ui::{
|
use ui::{
|
||||||
h_flex, relative, tooltip_container, v_flex, Checkbox, Clickable, Color, FluentBuilder,
|
h_flex, relative, tooltip_container, v_flex, ButtonCommon, Checkbox, Clickable, Color,
|
||||||
IconButton, IconName, IconSize, InteractiveElement, Label, LabelCommon, LabelSize, LinkPreview,
|
FluentBuilder, IconButton, IconName, IconSize, InteractiveElement, Label, LabelCommon,
|
||||||
StatefulInteractiveElement, StyledExt, StyledImage, ToggleState, ViewContext, VisibleOnHover,
|
LabelSize, LinkPreview, StatefulInteractiveElement, StyledExt, StyledImage, ToggleState,
|
||||||
VisualContext as _,
|
Tooltip, ViewContext, VisibleOnHover, VisualContext as _,
|
||||||
};
|
};
|
||||||
use workspace::Workspace;
|
use workspace::Workspace;
|
||||||
|
|
||||||
|
@ -385,6 +385,7 @@ fn render_markdown_code_block(
|
||||||
cx.write_to_clipboard(ClipboardItem::new_string(contents.to_string()));
|
cx.write_to_clipboard(ClipboardItem::new_string(contents.to_string()));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.tooltip(|cx| Tooltip::text("Copy code block", cx))
|
||||||
.visible_on_hover("markdown-block");
|
.visible_on_hover("markdown-block");
|
||||||
|
|
||||||
cx.with_common_p(div())
|
cx.with_common_p(div())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue