Merge branch 'main' into collab-panel2

Conrad Irwin created

Change summary

crates/collab_ui2/src/collab_panel.rs         | 2 +-
crates/editor2/src/hover_popover.rs           | 6 ++++--
crates/ui2/src/components.rs                  | 2 --
crates/ui2/src/components/disclosure.rs       | 7 +++----
crates/ui2/src/components/list.rs             | 4 ++--
crates/ui2/src/components/list/list_header.rs | 4 ++--
crates/ui2/src/components/list/list_item.rs   | 4 ++--
crates/ui2/src/slot.rs                        | 4 +---
crates/ui2/src/ui2.rs                         | 2 ++
9 files changed, 17 insertions(+), 18 deletions(-)

Detailed changes

crates/editor2/src/hover_popover.rs 🔗

@@ -15,7 +15,7 @@ use lsp::DiagnosticSeverity;
 use project::{HoverBlock, HoverBlockKind, InlayHintLabelPart, Project};
 use settings::Settings;
 use std::{ops::Range, sync::Arc, time::Duration};
-use ui::Tooltip;
+use ui::{StyledExt, Tooltip};
 use util::TryFutureExt;
 use workspace::Workspace;
 
@@ -476,8 +476,10 @@ impl InfoPopover {
     ) -> AnyElement {
         div()
             .id("info_popover")
+            .elevation_2(cx)
+            .text_ui()
+            .p_2()
             .overflow_y_scroll()
-            .bg(gpui::red())
             .max_w(max_size.width)
             .max_h(max_size.height)
             // Prevent a mouse move on the popover from being propagated to the editor,

crates/ui2/src/components.rs 🔗

@@ -11,7 +11,6 @@ mod keybinding;
 mod label;
 mod list;
 mod popover;
-mod slot;
 mod stack;
 mod tooltip;
 
@@ -31,7 +30,6 @@ pub use keybinding::*;
 pub use label::*;
 pub use list::*;
 pub use popover::*;
-pub use slot::*;
 pub use stack::*;
 pub use tooltip::*;
 

crates/ui2/src/components/disclosure.rs 🔗

@@ -34,10 +34,9 @@ impl RenderOnce for Disclosure {
     fn render(self, _cx: &mut WindowContext) -> Self::Rendered {
         IconButton::new(
             "toggle",
-            if self.is_open {
-                Icon::ChevronDown
-            } else {
-                Icon::ChevronRight
+            match self.is_open {
+                true => Icon::ChevronDown,
+                false => Icon::ChevronRight,
             },
         )
         .color(Color::Muted)

crates/ui2/src/components/list.rs 🔗

@@ -44,8 +44,8 @@ impl List {
         self
     }
 
-    pub fn toggle(mut self, toggle: Option<bool>) -> Self {
-        self.toggle = toggle;
+    pub fn toggle(mut self, toggle: impl Into<Option<bool>>) -> Self {
+        self.toggle = toggle.into();
         self
     }
 }

crates/ui2/src/components/list/list_header.rs 🔗

@@ -36,8 +36,8 @@ impl ListHeader {
         }
     }
 
-    pub fn toggle(mut self, toggle: Option<bool>) -> Self {
-        self.toggle = toggle;
+    pub fn toggle(mut self, toggle: impl Into<Option<bool>>) -> Self {
+        self.toggle = toggle.into();
         self
     }
 

crates/ui2/src/components/list/list_item.rs 🔗

@@ -70,8 +70,8 @@ impl ListItem {
         self
     }
 
-    pub fn toggle(mut self, toggle: Option<bool>) -> Self {
-        self.toggle = toggle;
+    pub fn toggle(mut self, toggle: impl Into<Option<bool>>) -> Self {
+        self.toggle = toggle.into();
         self
     }
 

crates/ui2/src/components/slot.rs → crates/ui2/src/slot.rs 🔗

@@ -2,11 +2,9 @@ use gpui::{ImageSource, SharedString};
 
 use crate::Icon;
 
-#[derive(Debug, Clone)]
 /// A slot utility that provides a way to to pass either
 /// an icon or an image to a component.
-///
-/// Can be filled with a []
+#[derive(Debug, Clone)]
 pub enum GraphicSlot {
     Icon(Icon),
     Avatar(ImageSource),

crates/ui2/src/ui2.rs 🔗

@@ -18,6 +18,7 @@ mod disableable;
 mod fixed;
 pub mod prelude;
 mod selectable;
+mod slot;
 mod styled_ext;
 mod styles;
 pub mod utils;
@@ -28,5 +29,6 @@ pub use disableable::*;
 pub use fixed::*;
 pub use prelude::*;
 pub use selectable::*;
+pub use slot::*;
 pub use styled_ext::*;
 pub use styles::*;