Reduce render allocations and redundant work in core components
This commit is contained in:
@@ -969,15 +969,10 @@ fn render_pane(
|
||||
.map(|tab| tab.view.clone());
|
||||
|
||||
// The cache keeps an un-notified panel from re-rendering on dock frames.
|
||||
let content_id = SharedString::from(format!("{dock_id}-content-{}", pane.key));
|
||||
let content = div()
|
||||
.id(SharedString::from(format!(
|
||||
"{dock_id}-content-{}",
|
||||
pane.key
|
||||
)))
|
||||
.debug_selector({
|
||||
let id = SharedString::from(format!("{dock_id}-content-{}", pane.key));
|
||||
move || id.to_string()
|
||||
})
|
||||
.id(content_id.clone())
|
||||
.debug_selector(move || content_id.to_string())
|
||||
.flex_1()
|
||||
.min_h_0()
|
||||
.overflow_hidden()
|
||||
@@ -999,6 +994,7 @@ fn render_pane(
|
||||
let pane = pane.clone();
|
||||
let titlebar = *titlebar;
|
||||
let padding_x = metrics.dense_padding_x;
|
||||
|
||||
move |window, cx| {
|
||||
let selected = pane
|
||||
.active
|
||||
@@ -1065,15 +1061,11 @@ fn render_pane(
|
||||
}
|
||||
});
|
||||
|
||||
let bar_id = SharedString::from(format!("{dock_id}-pane-{}-bar", pane.key));
|
||||
|
||||
h_flex()
|
||||
.id(SharedString::from(format!(
|
||||
"{dock_id}-pane-{}-bar",
|
||||
pane.key
|
||||
)))
|
||||
.debug_selector({
|
||||
let id = SharedString::from(format!("{dock_id}-pane-{}-bar", pane.key));
|
||||
move || id.to_string()
|
||||
})
|
||||
.id(bar_id.clone())
|
||||
.debug_selector(move || bar_id.to_string())
|
||||
.flex_none()
|
||||
.w_full()
|
||||
.h(titlebar.height)
|
||||
|
||||
Reference in New Issue
Block a user