Move more tooltip logic into gpui2 & fix tooltip moving on paint
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
3834e26f71
commit
4725cd2cd6
6 changed files with 61 additions and 54 deletions
|
@ -989,14 +989,11 @@ impl<'a> WindowContext<'a> {
|
|||
});
|
||||
} else if let Some(active_tooltip) = self.app.active_tooltip.take() {
|
||||
self.stack(1, |cx| {
|
||||
cx.with_element_offset(
|
||||
Some(cx.mouse_position() + Point::new(px(8.0), px(8.0))),
|
||||
|cx| {
|
||||
let available_space =
|
||||
size(AvailableSpace::MinContent, AvailableSpace::MinContent);
|
||||
active_tooltip.draw(available_space, cx);
|
||||
},
|
||||
);
|
||||
cx.with_element_offset(Some(active_tooltip.cursor_offset), |cx| {
|
||||
let available_space =
|
||||
size(AvailableSpace::MinContent, AvailableSpace::MinContent);
|
||||
active_tooltip.view.draw(available_space, cx);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue