Checkpoint: Compiling
This commit is contained in:
parent
8b972f6d8e
commit
9fb9885931
50 changed files with 139 additions and 146 deletions
|
@ -26,7 +26,7 @@ impl<S: 'static + Send + Sync> AssistantPanel<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
Panel::new(self.id.clone(), cx)
|
||||
.children(vec![div()
|
||||
.flex()
|
||||
|
@ -100,7 +100,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, AssistantPanel<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -35,7 +35,7 @@ impl<S: 'static + Send + Sync> Breadcrumb<S> {
|
|||
&mut self,
|
||||
view_state: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let symbols_len = self.symbols.len();
|
||||
|
@ -106,7 +106,7 @@ mod stories {
|
|||
&mut self,
|
||||
view_state: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -158,7 +158,7 @@ impl<S: 'static + Send + Sync + Clone> Buffer<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render_row(row: BufferRow, cx: &WindowContext) -> impl Element<ViewState = S> {
|
||||
fn render_row(row: BufferRow, cx: &WindowContext) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let line_background = if row.current {
|
||||
|
@ -208,7 +208,7 @@ impl<S: 'static + Send + Sync + Clone> Buffer<S> {
|
|||
}))
|
||||
}
|
||||
|
||||
fn render_rows(&self, cx: &WindowContext) -> Vec<impl Element<ViewState = S>> {
|
||||
fn render_rows(&self, cx: &WindowContext) -> Vec<impl Element<S>> {
|
||||
match &self.rows {
|
||||
Some(rows) => rows
|
||||
.rows
|
||||
|
@ -219,7 +219,7 @@ impl<S: 'static + Send + Sync + Clone> Buffer<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
let rows = self.render_rows(cx);
|
||||
|
||||
|
@ -262,7 +262,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -25,7 +25,7 @@ impl BufferSearch {
|
|||
view(cx.entity(|cx| Self::new()), Self::render)
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<Self> {
|
||||
let theme = theme(cx);
|
||||
|
||||
h_stack().bg(theme.toolbar).p_2().child(
|
||||
|
|
|
@ -24,7 +24,7 @@ impl<S: 'static + Send + Sync> ChatPanel<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div()
|
||||
.id(self.element_id.clone())
|
||||
.flex()
|
||||
|
@ -88,7 +88,7 @@ impl<S: 'static + Send + Sync> ChatMessage<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div()
|
||||
.flex()
|
||||
.flex_col()
|
||||
|
@ -133,7 +133,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, ChatPanel<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -19,7 +19,7 @@ impl<S: 'static + Send + Sync> CollabPanel<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
v_stack()
|
||||
|
@ -114,7 +114,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, CollabPanel<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync> CommandPalette<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div().id(self.id.clone()).child(
|
||||
Palette::new("palette")
|
||||
.items(example_editor_actions())
|
||||
|
@ -53,7 +53,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, CommandPalette<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -42,7 +42,7 @@ impl<S: 'static + Send + Sync> ContextMenu<S> {
|
|||
items: items.into_iter().collect(),
|
||||
}
|
||||
}
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
v_stack()
|
||||
|
@ -89,7 +89,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, ContextMenu<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -16,7 +16,7 @@ impl<S: 'static + Send + Sync + Clone> CopilotModal<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div().id(self.id.clone()).child(
|
||||
Modal::new("some-id")
|
||||
.title("Connect Copilot to Zed")
|
||||
|
@ -51,7 +51,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, CopilotModal<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -49,7 +49,7 @@ impl EditorPane {
|
|||
)
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<Self> {
|
||||
v_stack()
|
||||
.w_full()
|
||||
.h_full()
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync> Facepile<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let player_count = self.players.len();
|
||||
let player_list = self.players.iter().enumerate().map(|(ix, player)| {
|
||||
let isnt_last = ix < player_count - 1;
|
||||
|
@ -55,7 +55,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let players = static_players();
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -68,7 +68,7 @@ impl<S: 'static + Send + Sync> IconButton<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let icon_color = match (self.state, self.color) {
|
||||
|
|
|
@ -34,7 +34,7 @@ impl<S: 'static + Send + Sync> Keybinding<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div()
|
||||
.flex()
|
||||
.gap_2()
|
||||
|
@ -68,7 +68,7 @@ impl<S: 'static + Send + Sync> Key<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
div()
|
||||
|
@ -189,7 +189,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let all_modifier_permutations = ModifierKey::iter().permutations(2);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync + Clone> LanguageSelector<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div().id(self.id.clone()).child(
|
||||
Palette::new("palette")
|
||||
.items(vec![
|
||||
|
@ -64,7 +64,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, LanguageSelector<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -92,7 +92,7 @@ impl<S: 'static + Send + Sync> ListHeader<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let is_toggleable = self.toggleable != Toggleable::NotToggleable;
|
||||
|
@ -157,7 +157,7 @@ impl<S: 'static + Send + Sync> ListSubHeader<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
h_stack().flex_1().w_full().relative().py_1().child(
|
||||
div()
|
||||
.h_6()
|
||||
|
@ -230,7 +230,7 @@ impl<S: 'static + Send + Sync> From<ListSubHeader<S>> for ListItem<S> {
|
|||
}
|
||||
|
||||
impl<S: 'static + Send + Sync> ListItem<S> {
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
match self {
|
||||
ListItem::Entry(entry) => div().child(entry.render(view, cx)),
|
||||
ListItem::Separator(separator) => div().child(separator.render(view, cx)),
|
||||
|
@ -347,7 +347,7 @@ impl<S: 'static + Send + Sync> ListEntry<S> {
|
|||
fn disclosure_control(
|
||||
&mut self,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> Option<impl Element<ViewState = S>> {
|
||||
) -> Option<impl Element<S>> {
|
||||
let disclosure_control_icon = if let Some(ToggleState::Toggled) = self.toggle {
|
||||
IconElement::new(Icon::ChevronDown)
|
||||
} else {
|
||||
|
@ -367,7 +367,7 @@ impl<S: 'static + Send + Sync> ListEntry<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let settings = user_settings(cx);
|
||||
let theme = theme(cx);
|
||||
|
||||
|
@ -477,7 +477,7 @@ impl<S: 'static + Send + Sync> ListDetailsEntry<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
let settings = user_settings(cx);
|
||||
|
||||
|
@ -534,7 +534,7 @@ impl<S: 'static + Send + Sync> ListSeparator<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
div().h_px().w_full().bg(theme.border)
|
||||
|
@ -574,7 +574,7 @@ impl<S: 'static + Send + Sync> List<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let is_toggleable = self.toggleable != Toggleable::NotToggleable;
|
||||
let is_toggled = Toggleable::is_toggled(&self.toggleable);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ impl<S: 'static + Send + Sync> Modal<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
v_stack()
|
||||
|
@ -80,8 +80,8 @@ impl<S: 'static + Send + Sync> Modal<S> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S: 'static + Send + Sync> ParentElement for Modal<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<Self::ViewState>; 2]> {
|
||||
impl<S: 'static + Send + Sync> ParentElement<S> for Modal<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<S>; 2]> {
|
||||
&mut self.children
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync + Clone> MultiBuffer<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
v_stack()
|
||||
|
@ -66,7 +66,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -28,7 +28,7 @@ impl<S: 'static + Send + Sync + Clone> NotificationToast<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
h_stack()
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync> NotificationsPanel<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
div()
|
||||
|
@ -74,7 +74,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, NotificationsPanel<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -46,7 +46,7 @@ impl<S: 'static + Send + Sync> Palette<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
v_stack()
|
||||
|
@ -135,7 +135,7 @@ impl<S: 'static + Send + Sync> PaletteItem<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div()
|
||||
.flex()
|
||||
.flex_row()
|
||||
|
@ -176,7 +176,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, Palette<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -96,7 +96,7 @@ impl<S: 'static + Send + Sync> Panel<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let current_size = self.width.unwrap_or(self.initial_width);
|
||||
|
@ -121,8 +121,8 @@ impl<S: 'static + Send + Sync> Panel<S> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S: 'static + Send + Sync> ParentElement for Panel<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<Self::ViewState>; 2]> {
|
||||
impl<S: 'static + Send + Sync> ParentElement<S> for Panel<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<S>; 2]> {
|
||||
&mut self.children
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, Panel<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -40,7 +40,7 @@ impl<S: 'static + Send + Sync> Pane<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div()
|
||||
.id(self.id.clone())
|
||||
.flex()
|
||||
|
@ -70,8 +70,8 @@ impl<S: 'static + Send + Sync> Pane<S> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S: 'static + Send + Sync> ParentElement for Pane<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<Self::ViewState>; 2]> {
|
||||
impl<S: 'static + Send + Sync> ParentElement<S> for Pane<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<S>; 2]> {
|
||||
&mut self.children
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ impl<S: 'static + Send + Sync> PaneGroup<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
if !self.panes.is_empty() {
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync> PlayerStack<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
let player = self.player_with_call_status.get_player();
|
||||
self.player_with_call_status.get_call_status();
|
||||
|
|
|
@ -19,7 +19,7 @@ impl<S: 'static + Send + Sync> ProjectPanel<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
div()
|
||||
|
@ -83,7 +83,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, ProjectPanel<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync + Clone> RecentProjects<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div().id(self.id.clone()).child(
|
||||
Palette::new("palette")
|
||||
.items(vec![
|
||||
|
@ -60,7 +60,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, RecentProjects<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -86,7 +86,7 @@ impl StatusBar {
|
|||
&mut self,
|
||||
view: &mut Workspace,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
) -> impl Element<ViewState = Workspace> {
|
||||
) -> impl Element<Workspace> {
|
||||
let theme = theme(cx);
|
||||
|
||||
div()
|
||||
|
@ -101,11 +101,7 @@ impl StatusBar {
|
|||
.child(self.right_tools(view, cx))
|
||||
}
|
||||
|
||||
fn left_tools(
|
||||
&self,
|
||||
workspace: &mut Workspace,
|
||||
cx: &WindowContext,
|
||||
) -> impl Element<ViewState = Workspace> {
|
||||
fn left_tools(&self, workspace: &mut Workspace, cx: &WindowContext) -> impl Element<Workspace> {
|
||||
div()
|
||||
.flex()
|
||||
.items_center()
|
||||
|
@ -136,7 +132,7 @@ impl StatusBar {
|
|||
&self,
|
||||
workspace: &mut Workspace,
|
||||
cx: &WindowContext,
|
||||
) -> impl Element<ViewState = Workspace> {
|
||||
) -> impl Element<Workspace> {
|
||||
div()
|
||||
.flex()
|
||||
.items_center()
|
||||
|
|
|
@ -81,7 +81,7 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
let has_fs_conflict = self.fs_status == FileSystemStatus::Conflict;
|
||||
let is_deleted = self.fs_status == FileSystemStatus::Deleted;
|
||||
|
@ -192,7 +192,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let git_statuses = GitStatus::iter();
|
||||
let fs_statuses = FileSystemStatus::iter();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ impl<S: 'static + Send + Sync + Clone> TabBar<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let (can_navigate_back, can_navigate_forward) = self.can_navigate;
|
||||
|
@ -116,7 +116,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, TabBar<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync + Clone> Terminal<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let can_navigate_back = true;
|
||||
|
@ -109,7 +109,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, Terminal<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -17,7 +17,7 @@ impl<S: 'static + Send + Sync> ThemeSelector<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div().child(
|
||||
Palette::new(self.id.clone())
|
||||
.items(vec![
|
||||
|
@ -65,7 +65,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, ThemeSelector<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -87,7 +87,7 @@ impl TitleBar {
|
|||
)
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<Self> {
|
||||
let theme = theme(cx);
|
||||
let settings = user_settings(cx);
|
||||
|
||||
|
@ -204,7 +204,7 @@ mod stories {
|
|||
)
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<Self> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, TitleBar>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -36,7 +36,7 @@ impl<S: 'static + Send + Sync> Toast<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let mut div = div();
|
||||
|
@ -61,8 +61,8 @@ impl<S: 'static + Send + Sync> Toast<S> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<S: 'static + Send + Sync> ParentElement for Toast<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<Self::ViewState>; 2]> {
|
||||
impl<S: 'static + Send + Sync> ParentElement<S> for Toast<S> {
|
||||
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<S>; 2]> {
|
||||
&mut self.children
|
||||
}
|
||||
}
|
||||
|
@ -90,11 +90,7 @@ mod stories {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, Toast<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -54,7 +54,7 @@ impl<S: 'static + Send + Sync> Toolbar<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
div()
|
||||
|
@ -96,7 +96,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -25,7 +25,7 @@ impl<S: 'static + Send + Sync> TrafficLight<S> {
|
|||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
let fill = match (self.window_has_focus, self.color) {
|
||||
|
@ -58,7 +58,7 @@ impl<S: 'static + Send + Sync> TrafficLights<S> {
|
|||
self
|
||||
}
|
||||
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<S> {
|
||||
div()
|
||||
.flex()
|
||||
.items_center()
|
||||
|
@ -103,7 +103,7 @@ mod stories {
|
|||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
) -> impl Element<S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, TrafficLights<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -3,13 +3,13 @@ use std::sync::Arc;
|
|||
use chrono::DateTime;
|
||||
use gpui2::{px, relative, rems, view, Context, Size, View};
|
||||
|
||||
use crate::{prelude::*, NotificationsPanel};
|
||||
use crate::{
|
||||
static_livestream, old_theme, user_settings_mut, v_stack, AssistantPanel, Button, ChatMessage,
|
||||
old_theme, static_livestream, user_settings_mut, v_stack, AssistantPanel, Button, ChatMessage,
|
||||
ChatPanel, CollabPanel, EditorPane, FakeSettings, Label, LanguageSelector, Pane, PaneGroup,
|
||||
Panel, PanelAllowedSides, PanelSide, ProjectPanel, SettingValue, SplitDirection, StatusBar,
|
||||
Terminal, TitleBar, Toast, ToastOrigin,
|
||||
};
|
||||
use crate::{prelude::*, NotificationsPanel};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Gpui2UiDebug {
|
||||
|
@ -174,7 +174,7 @@ impl Workspace {
|
|||
view(cx.entity(|cx| Self::new(cx)), Self::render)
|
||||
}
|
||||
|
||||
pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
|
||||
pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<Self> {
|
||||
let theme = old_theme(cx).clone();
|
||||
|
||||
// HACK: This should happen inside of `debug_toggle_user_settings`, but
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue