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
|
@ -8,11 +8,11 @@ use anyhow::Result;
|
|||
use collections::{HashMap, HashSet, VecDeque};
|
||||
use futures::{stream::FuturesUnordered, StreamExt};
|
||||
use gpui::{
|
||||
actions, impl_actions, overlay, prelude::*, Action, AnchorCorner, AnyElement, AppContext,
|
||||
AsyncWindowContext, ClickEvent, DismissEvent, Div, DragMoveEvent, EntityId, EventEmitter,
|
||||
ExternalPaths, FocusHandle, FocusableView, Model, MouseButton, NavigationDirection, Pixels,
|
||||
Point, PromptLevel, Render, ScrollHandle, Subscription, Task, View, ViewContext, VisualContext,
|
||||
WeakFocusHandle, WeakView, WindowContext,
|
||||
actions, anchored, deferred, impl_actions, prelude::*, Action, AnchorCorner, AnyElement,
|
||||
AppContext, AsyncWindowContext, ClickEvent, DismissEvent, Div, DragMoveEvent, EntityId,
|
||||
EventEmitter, ExternalPaths, FocusHandle, FocusableView, Model, MouseButton,
|
||||
NavigationDirection, Pixels, Point, PromptLevel, Render, ScrollHandle, Subscription, Task,
|
||||
View, ViewContext, VisualContext, WeakFocusHandle, WeakView, WindowContext,
|
||||
};
|
||||
use parking_lot::Mutex;
|
||||
use project::{Project, ProjectEntryId, ProjectPath};
|
||||
|
@ -1567,7 +1567,11 @@ impl Pane {
|
|||
.bottom_0()
|
||||
.right_0()
|
||||
.size_0()
|
||||
.child(overlay().anchor(AnchorCorner::TopRight).child(menu.clone()))
|
||||
.child(deferred(
|
||||
anchored()
|
||||
.anchor(AnchorCorner::TopRight)
|
||||
.child(menu.clone()),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn set_zoomed(&mut self, zoomed: bool, cx: &mut ViewContext<Self>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue