Return impl IntoElement from Render::render trait

This commit is contained in:
Nathan Sobo
2024-01-02 10:09:05 -07:00
parent 0f33775a91
commit 1b5c8b2b4a
84 changed files with 550 additions and 110 deletions
+4 -4
View File
@@ -3,9 +3,9 @@ use std::{path::PathBuf, sync::Arc};
use crate::TerminalView;
use db::kvp::KEY_VALUE_STORE;
use gpui::{
actions, div, serde_json, AppContext, AsyncWindowContext, Element, Entity, EventEmitter,
ExternalPaths, FocusHandle, FocusableView, IntoElement, ParentElement, Pixels, Render, Styled,
Subscription, Task, View, ViewContext, VisualContext, WeakView, WindowContext,
actions, div, serde_json, AppContext, AsyncWindowContext, Entity, EventEmitter, ExternalPaths,
FocusHandle, FocusableView, IntoElement, ParentElement, Pixels, Render, Styled, Subscription,
Task, View, ViewContext, VisualContext, WeakView, WindowContext,
};
use project::Fs;
use serde::{Deserialize, Serialize};
@@ -329,7 +329,7 @@ impl TerminalPanel {
impl EventEmitter<PanelEvent> for TerminalPanel {}
impl Render for TerminalPanel {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
div().size_full().child(self.pane.clone())
}
}
+1 -1
View File
@@ -617,7 +617,7 @@ impl TerminalView {
}
impl Render for TerminalView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
let terminal_handle = self.terminal.clone();
let focused = self.focus_handle.is_focused(cx);