gpui: Rework overlay element (#9911)
There was a problem using deferred draws with `overlay` and tooltips at the same time. The `overlay` element was removed and was split up into two separate elements - `deferred` - `anchored` - Mimics the `overlay` behavior but does not render its children as deferred `tooltip_container` does not defer its drawing anymore and only uses `anchored`. /cc @as-cii Release Notes: - Fixed tooltip for the recent projects popover not showing anymore --------- Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
49144d94bf
commit
77f1cc95b8
12 changed files with 144 additions and 136 deletions
|
@ -6,9 +6,9 @@ use collections::HashSet;
|
|||
use editor::{scroll::Autoscroll, Editor};
|
||||
use futures::{stream::FuturesUnordered, StreamExt};
|
||||
use gpui::{
|
||||
div, impl_actions, overlay, AnyElement, AppContext, DismissEvent, EventEmitter, FocusHandle,
|
||||
FocusableView, KeyContext, KeyDownEvent, Keystroke, Model, MouseButton, MouseDownEvent, Pixels,
|
||||
Render, Styled, Subscription, Task, View, VisualContext, WeakView,
|
||||
anchored, deferred, div, impl_actions, AnyElement, AppContext, DismissEvent, EventEmitter,
|
||||
FocusHandle, FocusableView, KeyContext, KeyDownEvent, Keystroke, Model, MouseButton,
|
||||
MouseDownEvent, Pixels, Render, Styled, Subscription, Task, View, VisualContext, WeakView,
|
||||
};
|
||||
use language::Bias;
|
||||
use persistence::TERMINAL_DB;
|
||||
|
@ -765,10 +765,12 @@ impl Render for TerminalView {
|
|||
)),
|
||||
)
|
||||
.children(self.context_menu.as_ref().map(|(menu, position, _)| {
|
||||
overlay()
|
||||
.position(*position)
|
||||
.anchor(gpui::AnchorCorner::TopLeft)
|
||||
.child(menu.clone())
|
||||
deferred(
|
||||
anchored()
|
||||
.position(*position)
|
||||
.anchor(gpui::AnchorCorner::TopLeft)
|
||||
.child(menu.clone()),
|
||||
)
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue