Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Feb 4, 2025
1 parent 18a0549 commit 28abf62
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions crates/ui/src/dock/dock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use std::sync::Arc;

use gpui::{
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,
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,
};
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -394,6 +395,8 @@ impl Render for Dock {
return div();
}

let cache_style = StyleRefinement::default().v_flex().size_full();

div()
.relative()
.overflow_hidden()
Expand All @@ -408,8 +411,10 @@ impl Render for Dock {
})
.map(|this| match &self.panel {
DockItem::Split { view, .. } => this.child(view.clone()),
DockItem::Tabs { view, .. } => this.child(view.clone()),
DockItem::Panel { view, .. } => this.child(view.clone().view()),
DockItem::Tabs { view, .. } => {
this.child(AnyView::from(view.clone()).cached(cache_style))
}
DockItem::Panel { view, .. } => this.child(view.clone().view().cached(cache_style)),
// Not support to render Tiles and Tile into Dock
DockItem::Tiles { .. } => this,
})
Expand Down

0 comments on commit 28abf62

Please sign in to comment.