Merge branch 'main' into collab-panel2
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
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 []
|
||||
pub enum GraphicSlot {
|
||||
Icon(Icon),
|
||||
Avatar(ImageSource),
|
||||
PublicActor(SharedString),
|
||||
}
|
||||
Reference in New Issue
Block a user