@@ -1,9 +1,9 @@
use smallvec::SmallVec;
-use taffy::style::Position;
+use taffy::style::{Display, Position};
use crate::{
- point, px, AbsoluteLength, AnyElement, BorrowWindow, Bounds, Component, Element, LayoutId,
- ParentComponent, Pixels, Point, Size, Style,
+ point, AnyElement, BorrowWindow, Bounds, Component, Element, LayoutId, ParentComponent, Pixels,
+ Point, Size, Style,
};
pub struct OverlayState {
@@ -76,6 +76,7 @@ impl<V: 'static> Element<V> for Overlay<V> {
let mut overlay_style = Style::default();
overlay_style.position = Position::Absolute;
+ overlay_style.display = Display::Flex;
let layout_id = cx.request_layout(&overlay_style, child_layout_ids.iter().copied());
@@ -108,7 +109,6 @@ impl<V: 'static> Element<V> for Overlay<V> {
origin: Point::zero(),
size: cx.viewport_size(),
};
- dbg!(bounds, desired, limits);
match self.fit_mode {
OverlayFitMode::SnapToWindow => {
@@ -1,11 +1,11 @@
use std::cell::RefCell;
use std::rc::Rc;
-use crate::{h_stack, prelude::*, ListItemVariant};
+use crate::{prelude::*, ListItemVariant};
use crate::{v_stack, Label, List, ListEntry, ListItem, ListSeparator, ListSubHeader};
use gpui::{
- overlay, px, Action, AnyElement, Bounds, DispatchPhase, Div, EventEmitter, FocusHandle,
- Focusable, FocusableView, LayoutId, MouseButton, MouseDownEvent, Overlay, Render, View,
+ overlay, px, Action, AnyElement, Bounds, DispatchPhase, EventEmitter, FocusHandle,
+ FocusableView, LayoutId, MouseButton, MouseDownEvent, Overlay, Render, View,
};
use smallvec::SmallVec;
@@ -5,6 +5,7 @@ use crate::{ElevationIndex, UITextSize};
fn elevated<E: Styled, V: 'static>(this: E, cx: &mut ViewContext<V>, index: ElevationIndex) -> E {
this.bg(cx.theme().colors().elevated_surface_background)
+ .z_index(index.z_index())
.rounded_lg()
.border()
.border_color(cx.theme().colors().border_variant)