Merge branch 'main' into collab_ui-zed2

This commit is contained in:
Piotr Osiewicz
2023-11-23 15:02:55 +01:00
51 changed files with 339 additions and 323 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::{status_bar::StatusItemView, Axis, Workspace};
use gpui::{
div, px, Action, AnchorCorner, AnyView, AppContext, Div, Entity, EntityId, EventEmitter,
FocusHandle, FocusableView, ParentElement, Render, RenderOnce, SharedString, Styled,
FocusHandle, FocusableView, IntoElement, ParentElement, Render, SharedString, Styled,
Subscription, View, ViewContext, VisualContext, WeakView, WindowContext,
};
use schemars::JsonSchema;
+2 -2
View File
@@ -1344,7 +1344,7 @@ impl Pane {
item: &Box<dyn ItemHandle>,
detail: usize,
cx: &mut ViewContext<'_, Pane>,
) -> impl RenderOnce {
) -> impl IntoElement {
let label = item.tab_content(Some(detail), cx);
let close_icon = || {
let id = item.item_id();
@@ -1439,7 +1439,7 @@ impl Pane {
)
}
fn render_tab_bar(&mut self, cx: &mut ViewContext<'_, Pane>) -> impl RenderOnce {
fn render_tab_bar(&mut self, cx: &mut ViewContext<'_, Pane>) -> impl IntoElement {
div()
.group("tab_bar")
.id("tab_bar")
+5 -5
View File
@@ -6,7 +6,7 @@ use db2::sqlez::{
statement::Statement,
};
use gpui::{
point, size, AnyWeakView, Bounds, Div, Model, Pixels, Point, RenderOnce, View, ViewContext,
point, size, AnyWeakView, Bounds, Div, IntoElement, Model, Pixels, Point, View, ViewContext,
};
use parking_lot::Mutex;
use project2::Project;
@@ -130,7 +130,7 @@ impl PaneGroup {
zoomed: Option<&AnyWeakView>,
app_state: &Arc<AppState>,
cx: &mut ViewContext<Workspace>,
) -> impl RenderOnce {
) -> impl IntoElement {
self.root.render(
project,
0,
@@ -200,7 +200,7 @@ impl Member {
zoomed: Option<&AnyWeakView>,
app_state: &Arc<AppState>,
cx: &mut ViewContext<Workspace>,
) -> impl RenderOnce {
) -> impl IntoElement {
match self {
Member::Pane(pane) => {
// todo!()
@@ -579,8 +579,8 @@ impl PaneAxis {
app_state,
cx,
)
.render_into_any(),
Member::Pane(pane) => pane.clone().render_into_any(),
.into_any_element(),
Member::Pane(pane) => pane.clone().into_any_element(),
}
}))
+3 -3
View File
@@ -2,7 +2,7 @@ use std::any::TypeId;
use crate::{ItemHandle, Pane};
use gpui::{
div, AnyView, Div, ParentElement, Render, RenderOnce, Styled, Subscription, View, ViewContext,
div, AnyView, Div, IntoElement, ParentElement, Render, Styled, Subscription, View, ViewContext,
WindowContext,
};
use theme2::ActiveTheme;
@@ -53,14 +53,14 @@ impl Render for StatusBar {
}
impl StatusBar {
fn render_left_tools(&self, cx: &mut ViewContext<Self>) -> impl RenderOnce {
fn render_left_tools(&self, cx: &mut ViewContext<Self>) -> impl IntoElement {
h_stack()
.items_center()
.gap_2()
.children(self.left_items.iter().map(|item| item.to_any()))
}
fn render_right_tools(&self, cx: &mut ViewContext<Self>) -> impl RenderOnce {
fn render_right_tools(&self, cx: &mut ViewContext<Self>) -> impl IntoElement {
h_stack()
.items_center()
.gap_2()