dock: Revert AnyView cached (#607)
* This may cause the interface to not update in real time.
This commit is contained in:
parent
2e3f3dd669
commit
2479fc3418
3 changed files with 9 additions and 18 deletions
|
|
@ -57,7 +57,7 @@ GPUI and GPUI Component still in development, so we need add dependency by git.
|
|||
And GPUI Component depends on `gpui` by special version (It keep updated to upstream) for including WebView support.
|
||||
|
||||
```toml
|
||||
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window" }
|
||||
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "webview" }
|
||||
gpui-component = { git = "https://github.com/longbridge/gpui-component.git" }
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,9 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gpui::{
|
||||
div, prelude::FluentBuilder as _, px, AnyView, App, AppContext, Axis, Context, Element, Empty,
|
||||
Entity, InteractiveElement as _, IntoElement, MouseMoveEvent, MouseUpEvent, ParentElement as _,
|
||||
Pixels, Point, Render, StatefulInteractiveElement, Style, StyleRefinement, Styled as _,
|
||||
WeakEntity, Window,
|
||||
div, prelude::FluentBuilder as _, px, App, AppContext, Axis, Context, Element, Empty, Entity,
|
||||
InteractiveElement as _, IntoElement, MouseMoveEvent, MouseUpEvent, ParentElement as _, Pixels,
|
||||
Point, Render, StatefulInteractiveElement, Style, Styled as _, WeakEntity, Window,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
|
@ -395,8 +394,6 @@ impl Render for Dock {
|
|||
return div();
|
||||
}
|
||||
|
||||
let cache_style = StyleRefinement::default().v_flex().size_full();
|
||||
|
||||
div()
|
||||
.relative()
|
||||
.overflow_hidden()
|
||||
|
|
@ -411,10 +408,8 @@ impl Render for Dock {
|
|||
})
|
||||
.map(|this| match &self.panel {
|
||||
DockItem::Split { view, .. } => this.child(view.clone()),
|
||||
DockItem::Tabs { view, .. } => {
|
||||
this.child(AnyView::from(view.clone()).cached(cache_style))
|
||||
}
|
||||
DockItem::Panel { view, .. } => this.child(view.clone().view().cached(cache_style)),
|
||||
DockItem::Tabs { view, .. } => this.child(view.clone()),
|
||||
DockItem::Panel { view, .. } => this.child(view.clone().view()),
|
||||
// Not support to render Tiles and Tile into Dock
|
||||
DockItem::Tiles { .. } => this,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use gpui::{
|
|||
div, prelude::FluentBuilder, px, rems, App, AppContext, Context, Corner, DefiniteLength,
|
||||
DismissEvent, DragMoveEvent, Empty, Entity, EventEmitter, FocusHandle, Focusable,
|
||||
InteractiveElement as _, IntoElement, ParentElement, Pixels, Render, ScrollHandle,
|
||||
SharedString, StatefulInteractiveElement, StyleRefinement, Styled, WeakEntity, Window,
|
||||
SharedString, StatefulInteractiveElement, Styled, WeakEntity, Window,
|
||||
};
|
||||
use rust_i18n::t;
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ use crate::{
|
|||
h_flex,
|
||||
popup_menu::{PopupMenu, PopupMenuExt},
|
||||
tab::{Tab, TabBar},
|
||||
v_flex, ActiveTheme, AxisExt, IconName, Placement, Selectable, Sizable, StyledExt as _,
|
||||
v_flex, ActiveTheme, AxisExt, IconName, Placement, Selectable, Sizable,
|
||||
};
|
||||
|
||||
use super::{
|
||||
|
|
@ -767,11 +767,7 @@ impl TabPanel {
|
|||
.overflow_y_scroll()
|
||||
.overflow_x_hidden()
|
||||
.flex_1()
|
||||
.child(
|
||||
active_panel
|
||||
.view()
|
||||
.cached(StyleRefinement::default().v_flex().size_full()),
|
||||
)
|
||||
.child(active_panel.view())
|
||||
.when(state.droppable, |this| {
|
||||
this.on_drag_move(cx.listener(Self::on_panel_drag_move))
|
||||
.child(
|
||||
|
|
|
|||
Loading…
Reference in a new issue