Add .visible_on_hover helper method (#3639)
This PR adds a `.visible_on_hover` helper method that can be used to
make an element only visible on hover.
I noticed we were repeating this similar stanza in a bunch of different
spots:
```rs
some_element
.invisible()
.group_hover("", |style| style.visible())
```
so it seemed like a nice thing to factor out into a reusable utility.
Release Notes:
- N/A
This commit is contained in:
@@ -9766,8 +9766,7 @@ pub fn diagnostic_block_renderer(diagnostic: Diagnostic, is_valid: bool) -> Rend
|
||||
div()
|
||||
.border()
|
||||
.border_color(gpui::red())
|
||||
.invisible()
|
||||
.group_hover(group_id, |style| style.visible())
|
||||
.visible_on_hover(group_id)
|
||||
.child(
|
||||
IconButton::new(copy_id.clone(), Icon::Copy)
|
||||
.icon_color(Color::Muted)
|
||||
|
||||
Reference in New Issue
Block a user