Clean up Element API and start on docs

This commit is contained in:
Nathan Sobo
2023-12-31 08:33:40 -07:00
parent 5f2bb82ef3
commit 83923fd6d5
125 changed files with 370 additions and 335 deletions
+2 -2
View File
@@ -9291,9 +9291,9 @@ impl FocusableView for Editor {
}
impl Render for Editor {
type Element = EditorElement;
type Output = EditorElement;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Output {
let settings = ThemeSettings::get_global(cx);
let text_style = match self.mode {
EditorMode::SingleLine | EditorMode::AutoHeight { .. } => TextStyle {
+1 -1
View File
@@ -2757,7 +2757,7 @@ enum Invisible {
impl Element for EditorElement {
type State = ();
fn layout(
fn request_layout(
&mut self,
_element_state: Option<Self::State>,
cx: &mut gpui::WindowContext,
+2 -2
View File
@@ -1193,9 +1193,9 @@ impl CursorPosition {
}
impl Render for CursorPosition {
type Element = Div;
type Output = Div;
fn render(&mut self, _: &mut ViewContext<Self>) -> Self::Element {
fn render(&mut self, _: &mut ViewContext<Self>) -> Self::Output {
div().when_some(self.position, |el, position| {
let mut text = format!(
"{}{FILE_ROW_COLUMN_DELIMITER}{}",