This commit is contained in:
Conrad Irwin 2023-11-16 19:50:31 -07:00
parent 547888942f
commit 9547e88d88
3 changed files with 8 additions and 7 deletions

View file

@ -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 => {

View file

@ -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;

View file

@ -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)