Rename back to div

This commit is contained in:
Nathan Sobo
2023-11-14 01:41:55 -07:00
parent be18c47912
commit c6e8a097a3
62 changed files with 154 additions and 156 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
use crate::{status_bar::StatusItemView, Axis, Workspace};
use gpui::{
div, Action, AnyView, AppContext, Entity, EntityId, EventEmitter, Node, ParentComponent,
div, Action, AnyView, AppContext, Entity, EntityId, EventEmitter, Div, ParentComponent,
Render, Subscription, View, ViewContext, WeakView, WindowContext,
};
use schemars::JsonSchema;
@@ -419,7 +419,7 @@ impl Dock {
}
impl Render for Dock {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
todo!()
@@ -621,7 +621,7 @@ impl PanelButtons {
// }
impl Render for PanelButtons {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
// todo!()
@@ -647,7 +647,7 @@ impl StatusItemView for PanelButtons {
#[cfg(any(test, feature = "test-support"))]
pub mod test {
use super::*;
use gpui::{div, Node, ViewContext, WindowContext};
use gpui::{div, Div, ViewContext, WindowContext};
pub struct TestPanel {
pub position: DockPosition,
@@ -672,7 +672,7 @@ pub mod test {
}
impl Render for TestPanel {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element {
div()
+2 -2
View File
@@ -1,5 +1,5 @@
use gpui::{
div, prelude::*, px, AnyView, EventEmitter, FocusHandle, Node, Render, Subscription, View,
div, prelude::*, px, AnyView, EventEmitter, FocusHandle, Div, Render, Subscription, View,
ViewContext, WindowContext,
};
use ui::v_stack;
@@ -76,7 +76,7 @@ impl ModalLayer {
}
impl Render for ModalLayer {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let Some(active_modal) = &self.active_modal else {
+2 -2
View File
@@ -165,7 +165,7 @@ impl Workspace {
pub mod simple_message_notification {
use super::{Notification, NotificationEvent};
use gpui::{AnyElement, AppContext, EventEmitter, Node, Render, TextStyle, ViewContext};
use gpui::{AnyElement, AppContext, EventEmitter, Div, Render, TextStyle, ViewContext};
use serde::Deserialize;
use std::{borrow::Cow, sync::Arc};
@@ -252,7 +252,7 @@ pub mod simple_message_notification {
}
impl Render for MessageNotification {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
todo!()
+3 -3
View File
@@ -8,7 +8,7 @@ use anyhow::Result;
use collections::{HashMap, HashSet, VecDeque};
use gpui::{
actions, prelude::*, register_action, AppContext, AsyncWindowContext, Component, EntityId,
EventEmitter, FocusHandle, Model, Node, PromptLevel, Render, Task, View, ViewContext,
EventEmitter, FocusHandle, Model, Div, PromptLevel, Render, Task, View, ViewContext,
VisualContext, WeakView, WindowContext,
};
use parking_lot::Mutex;
@@ -1901,7 +1901,7 @@ impl Pane {
// }
impl Render for Pane {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
v_stack()
@@ -2926,7 +2926,7 @@ struct DraggedTab {
}
impl Render for DraggedTab {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
div().w_8().h_4().bg(gpui::red())
+2 -2
View File
@@ -2,7 +2,7 @@ use std::any::TypeId;
use crate::{ItemHandle, Pane};
use gpui::{
div, AnyView, Component, Node, ParentComponent, Render, Styled, Subscription, View,
div, AnyView, Component, Div, ParentComponent, Render, Styled, Subscription, View,
ViewContext, WindowContext,
};
use theme2::ActiveTheme;
@@ -34,7 +34,7 @@ pub struct StatusBar {
}
impl Render for StatusBar {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
div()
+2 -2
View File
@@ -1,6 +1,6 @@
use crate::ItemHandle;
use gpui::{
AnyView, Entity, EntityId, EventEmitter, Node, Render, View, ViewContext, WindowContext,
AnyView, Div, Entity, EntityId, EventEmitter, Render, View, ViewContext, WindowContext,
};
pub enum ToolbarItemEvent {
@@ -52,7 +52,7 @@ pub struct Toolbar {
}
impl Render for Toolbar {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
todo!()
+4 -4
View File
@@ -38,7 +38,7 @@ use futures::{
use gpui::{
actions, div, point, prelude::*, rems, size, Action, AnyModel, AnyView, AnyWeakView,
AppContext, AsyncAppContext, AsyncWindowContext, Bounds, Component, Entity, EntityId,
EventEmitter, FocusHandle, GlobalPixels, KeyContext, Model, ModelContext, Node,
EventEmitter, FocusHandle, GlobalPixels, KeyContext, Model, ModelContext, Div,
ParentComponent, Point, Render, Size, Styled, Subscription, Task, View, ViewContext, WeakView,
WindowBounds, WindowContext, WindowHandle, WindowOptions,
};
@@ -529,7 +529,7 @@ pub enum Event {
pub struct Workspace {
weak_self: WeakView<Self>,
focus_handle: FocusHandle,
workspace_actions: Vec<Box<dyn Fn(Node<Workspace>) -> Node<Workspace>>>,
workspace_actions: Vec<Box<dyn Fn(Div<Workspace>) -> Div<Workspace>>>,
zoomed: Option<AnyWeakView>,
zoomed_position: Option<DockPosition>,
center: PaneGroup,
@@ -3503,7 +3503,7 @@ impl Workspace {
}));
}
fn add_workspace_actions_listeners(&self, mut div: Node<Workspace>) -> Node<Workspace> {
fn add_workspace_actions_listeners(&self, mut div: Div<Workspace>) -> Div<Workspace> {
for action in self.workspace_actions.iter() {
div = (action)(div)
}
@@ -3728,7 +3728,7 @@ fn notify_if_database_failed(workspace: WindowHandle<Workspace>, cx: &mut AsyncA
impl EventEmitter<Event> for Workspace {}
impl Render for Workspace {
type Element = Node<Self>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let mut context = KeyContext::default();