From 4c7eaaebb11e3effa2920ccbae2d2ae422608781 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 3 Sep 2021 13:01:12 +0200 Subject: [PATCH] Use `Flexible` in file finder and theme switcher instead of `Expanded` --- gpui/src/elements/uniform_list.rs | 2 ++ gpui/src/scene.rs | 4 +++- zed/src/file_finder.rs | 4 ++-- zed/src/theme_selector.rs | 7 ++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gpui/src/elements/uniform_list.rs b/gpui/src/elements/uniform_list.rs index 04435bb36eb28e2b06d7d52880e193ade25a3b5a..c82d8aa3d6fc740c3179f50b367348b32816cc76 100644 --- a/gpui/src/elements/uniform_list.rs +++ b/gpui/src/elements/uniform_list.rs @@ -150,6 +150,8 @@ where for item in &mut items { item.layout(item_constraint, cx); } + } else { + size = constraint.min; } ( diff --git a/gpui/src/scene.rs b/gpui/src/scene.rs index 012c43647ef9de5c2b2630644cf82f8844bfcfab..0bd0fe8a77fe5899421981419eedd088c38ab54a 100644 --- a/gpui/src/scene.rs +++ b/gpui/src/scene.rs @@ -210,7 +210,9 @@ impl StackingContext { clip_bounds .intersection(parent_clip_bounds.unwrap_or(clip_bounds)) .unwrap_or_else(|| { - log::warn!("specified clip bounds are disjoint from parent layer"); + if !clip_bounds.is_empty() { + log::warn!("specified clip bounds are disjoint from parent layer"); + } RectF::default() }) }) diff --git a/zed/src/file_finder.rs b/zed/src/file_finder.rs index cd74709421832c6d47ae5cfd7579ffad0f500bdb..b7394cd553437e7ea5c0cb858c30202c3d7044cb 100644 --- a/zed/src/file_finder.rs +++ b/zed/src/file_finder.rs @@ -87,7 +87,7 @@ impl View for FileFinder { Container::new( Flex::new(Axis::Vertical) .with_child(ChildView::new(self.query_editor.id()).boxed()) - .with_child(Expanded::new(1.0, self.render_matches()).boxed()) + .with_child(Flexible::new(1.0, self.render_matches()).boxed()) .boxed(), ) .with_style(&settings.theme.selector.container) @@ -173,7 +173,7 @@ impl FileFinder { .boxed(), ) .with_child( - Expanded::new( + Flexible::new( 1.0, Flex::column() .with_child( diff --git a/zed/src/theme_selector.rs b/zed/src/theme_selector.rs index 714e84b03fbb1d7b7113f25dc10300ca584eec8d..28fea8f6c00b2f96d70e9b0cc8811864487a5b5c 100644 --- a/zed/src/theme_selector.rs +++ b/zed/src/theme_selector.rs @@ -9,10 +9,7 @@ use crate::{ }; use gpui::{ action, - elements::{ - Align, ChildView, ConstrainedBox, Container, Expanded, Flex, Label, ParentElement, - UniformList, UniformListState, - }, + elements::*, keymap::{self, menu, Binding}, AppContext, Axis, Element, ElementBox, Entity, MutableAppContext, RenderContext, View, ViewContext, ViewHandle, @@ -283,7 +280,7 @@ impl View for ThemeSelector { Container::new( Flex::new(Axis::Vertical) .with_child(ChildView::new(self.query_editor.id()).boxed()) - .with_child(Expanded::new(1.0, self.render_matches(cx)).boxed()) + .with_child(Flexible::new(1.0, self.render_matches(cx)).boxed()) .boxed(), ) .with_style(&settings.theme.selector.container)