Remove more references to 'model' in GPUI APIs (#23693)
Release Notes: - N/A
This commit is contained in:
parent
a6b1514246
commit
9cae96f82f
115 changed files with 309 additions and 311 deletions
|
@ -396,7 +396,7 @@ impl Pane {
|
|||
cx.subscribe(&project, Self::project_events),
|
||||
];
|
||||
|
||||
let handle = cx.model().downgrade();
|
||||
let handle = cx.entity().downgrade();
|
||||
Self {
|
||||
alternate_file_items: (None, None),
|
||||
focus_handle,
|
||||
|
@ -756,7 +756,7 @@ impl Pane {
|
|||
|
||||
fn navigate_backward(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if let Some(workspace) = self.workspace.upgrade() {
|
||||
let pane = cx.model().downgrade();
|
||||
let pane = cx.entity().downgrade();
|
||||
window.defer(cx, move |window, cx| {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
workspace.go_back(pane, window, cx).detach_and_log_err(cx)
|
||||
|
@ -767,7 +767,7 @@ impl Pane {
|
|||
|
||||
fn navigate_forward(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if let Some(workspace) = self.workspace.upgrade() {
|
||||
let pane = cx.model().downgrade();
|
||||
let pane = cx.entity().downgrade();
|
||||
window.defer(cx, move |window, cx| {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
workspace
|
||||
|
@ -1992,7 +1992,7 @@ impl Pane {
|
|||
|
||||
fn update_status_bar(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
let workspace = self.workspace.clone();
|
||||
let pane = cx.model().clone();
|
||||
let pane = cx.entity().clone();
|
||||
|
||||
window.defer(cx, move |window, cx| {
|
||||
let Ok(status_bar) = workspace.update(cx, |workspace, _| workspace.status_bar.clone())
|
||||
|
@ -2044,7 +2044,7 @@ impl Pane {
|
|||
|
||||
fn pin_tab_at(&mut self, ix: usize, window: &mut Window, cx: &mut Context<Self>) {
|
||||
maybe!({
|
||||
let pane = cx.model().clone();
|
||||
let pane = cx.entity().clone();
|
||||
let destination_index = self.pinned_tab_count.min(ix);
|
||||
self.pinned_tab_count += 1;
|
||||
let id = self.item_for_index(ix)?.item_id();
|
||||
|
@ -2067,7 +2067,7 @@ impl Pane {
|
|||
|
||||
fn unpin_tab_at(&mut self, ix: usize, window: &mut Window, cx: &mut Context<Self>) {
|
||||
maybe!({
|
||||
let pane = cx.model().clone();
|
||||
let pane = cx.entity().clone();
|
||||
self.pinned_tab_count = self.pinned_tab_count.checked_sub(1)?;
|
||||
let destination_index = self.pinned_tab_count;
|
||||
|
||||
|
@ -2214,7 +2214,7 @@ impl Pane {
|
|||
.on_drag(
|
||||
DraggedTab {
|
||||
item: item.boxed_clone(),
|
||||
pane: cx.model().clone(),
|
||||
pane: cx.entity().clone(),
|
||||
detail,
|
||||
is_active,
|
||||
ix,
|
||||
|
@ -2328,7 +2328,7 @@ impl Pane {
|
|||
};
|
||||
|
||||
let is_pinned = self.is_tab_pinned(ix);
|
||||
let pane = cx.model().downgrade();
|
||||
let pane = cx.entity().downgrade();
|
||||
let menu_context = item.item_focus_handle(cx);
|
||||
right_click_menu(ix).trigger(tab).menu(move |window, cx| {
|
||||
let pane = pane.clone();
|
||||
|
@ -2534,7 +2534,7 @@ impl Pane {
|
|||
let navigate_backward = IconButton::new("navigate_backward", IconName::ArrowLeft)
|
||||
.icon_size(IconSize::Small)
|
||||
.on_click({
|
||||
let model = cx.model().clone();
|
||||
let model = cx.entity().clone();
|
||||
move |_, window, cx| model.update(cx, |pane, cx| pane.navigate_backward(window, cx))
|
||||
})
|
||||
.disabled(!self.can_navigate_backward())
|
||||
|
@ -2548,7 +2548,7 @@ impl Pane {
|
|||
let navigate_forward = IconButton::new("navigate_forward", IconName::ArrowRight)
|
||||
.icon_size(IconSize::Small)
|
||||
.on_click({
|
||||
let model = cx.model().clone();
|
||||
let model = cx.entity().clone();
|
||||
move |_, window, cx| model.update(cx, |pane, cx| pane.navigate_forward(window, cx))
|
||||
})
|
||||
.disabled(!self.can_navigate_forward())
|
||||
|
@ -2732,7 +2732,7 @@ impl Pane {
|
|||
return;
|
||||
}
|
||||
}
|
||||
let mut to_pane = cx.model().clone();
|
||||
let mut to_pane = cx.entity().clone();
|
||||
let split_direction = self.drag_split_direction;
|
||||
let item_id = dragged_tab.item.item_id();
|
||||
if let Some(preview_item_id) = self.preview_item_id {
|
||||
|
@ -2821,7 +2821,7 @@ impl Pane {
|
|||
return;
|
||||
}
|
||||
}
|
||||
let mut to_pane = cx.model().clone();
|
||||
let mut to_pane = cx.entity().clone();
|
||||
let split_direction = self.drag_split_direction;
|
||||
let project_entry_id = *project_entry_id;
|
||||
self.workspace
|
||||
|
@ -2895,7 +2895,7 @@ impl Pane {
|
|||
return;
|
||||
}
|
||||
}
|
||||
let mut to_pane = cx.model().clone();
|
||||
let mut to_pane = cx.entity().clone();
|
||||
let mut split_direction = self.drag_split_direction;
|
||||
let paths = paths.paths().to_vec();
|
||||
let is_remote = self
|
||||
|
@ -3246,7 +3246,7 @@ impl Render for Pane {
|
|||
MouseButton::Navigate(NavigationDirection::Back),
|
||||
cx.listener(|pane, _, window, cx| {
|
||||
if let Some(workspace) = pane.workspace.upgrade() {
|
||||
let pane = cx.model().downgrade();
|
||||
let pane = cx.entity().downgrade();
|
||||
window.defer(cx, move |window, cx| {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
workspace.go_back(pane, window, cx).detach_and_log_err(cx)
|
||||
|
@ -3259,7 +3259,7 @@ impl Render for Pane {
|
|||
MouseButton::Navigate(NavigationDirection::Forward),
|
||||
cx.listener(|pane, _, window, cx| {
|
||||
if let Some(workspace) = pane.workspace.upgrade() {
|
||||
let pane = cx.model().downgrade();
|
||||
let pane = cx.entity().downgrade();
|
||||
window.defer(cx, move |window, cx| {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
workspace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue