Cleanups preparing for WindowContext refactor (#22475)
* Remove unnecessary WindowContext and ViewContext '_ lifetimes * Removed some cases where WindowContext has a different name than `cx`. Release Notes: - N/A
This commit is contained in:
parent
9815358bdd
commit
016b5d60e1
41 changed files with 127 additions and 152 deletions
|
@ -1706,11 +1706,11 @@ impl Workspace {
|
|||
cx.defer(|cx| {
|
||||
cx.windows().iter().find(|window| {
|
||||
window
|
||||
.update(cx, |_, window| {
|
||||
if window.is_window_active() {
|
||||
.update(cx, |_, cx| {
|
||||
if cx.is_window_active() {
|
||||
//This can only get called when the window's project connection has been lost
|
||||
//so we don't need to prompt the user for anything and instead just close the window
|
||||
window.remove_window();
|
||||
cx.remove_window();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
@ -4561,7 +4561,7 @@ impl Workspace {
|
|||
div
|
||||
}
|
||||
|
||||
pub fn has_active_modal(&self, cx: &WindowContext<'_>) -> bool {
|
||||
pub fn has_active_modal(&self, cx: &WindowContext) -> bool {
|
||||
self.modal_layer.read(cx).has_active_modal()
|
||||
}
|
||||
|
||||
|
@ -5018,7 +5018,7 @@ impl Render for Workspace {
|
|||
fn resize_bottom_dock(
|
||||
new_size: Pixels,
|
||||
workspace: &mut Workspace,
|
||||
cx: &mut ViewContext<'_, Workspace>,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
) {
|
||||
let size = new_size.min(workspace.bounds.bottom() - RESIZE_HANDLE_SIZE);
|
||||
workspace.bottom_dock.update(cx, |bottom_dock, cx| {
|
||||
|
@ -5026,22 +5026,14 @@ fn resize_bottom_dock(
|
|||
});
|
||||
}
|
||||
|
||||
fn resize_right_dock(
|
||||
new_size: Pixels,
|
||||
workspace: &mut Workspace,
|
||||
cx: &mut ViewContext<'_, Workspace>,
|
||||
) {
|
||||
fn resize_right_dock(new_size: Pixels, workspace: &mut Workspace, cx: &mut ViewContext<Workspace>) {
|
||||
let size = new_size.max(workspace.bounds.left() - RESIZE_HANDLE_SIZE);
|
||||
workspace.right_dock.update(cx, |right_dock, cx| {
|
||||
right_dock.resize_active_panel(Some(size), cx);
|
||||
});
|
||||
}
|
||||
|
||||
fn resize_left_dock(
|
||||
new_size: Pixels,
|
||||
workspace: &mut Workspace,
|
||||
cx: &mut ViewContext<'_, Workspace>,
|
||||
) {
|
||||
fn resize_left_dock(new_size: Pixels, workspace: &mut Workspace, cx: &mut ViewContext<Workspace>) {
|
||||
let size = new_size.min(workspace.bounds.right() - RESIZE_HANDLE_SIZE);
|
||||
|
||||
workspace.left_dock.update(cx, |left_dock, cx| {
|
||||
|
@ -6149,7 +6141,7 @@ fn resize_edge(
|
|||
}
|
||||
}
|
||||
|
||||
fn join_pane_into_active(active_pane: &View<Pane>, pane: &View<Pane>, cx: &mut WindowContext<'_>) {
|
||||
fn join_pane_into_active(active_pane: &View<Pane>, pane: &View<Pane>, cx: &mut WindowContext) {
|
||||
if pane == active_pane {
|
||||
return;
|
||||
} else if pane.read(cx).items_len() == 0 {
|
||||
|
@ -6163,7 +6155,7 @@ fn join_pane_into_active(active_pane: &View<Pane>, pane: &View<Pane>, cx: &mut W
|
|||
}
|
||||
}
|
||||
|
||||
fn move_all_items(from_pane: &View<Pane>, to_pane: &View<Pane>, cx: &mut WindowContext<'_>) {
|
||||
fn move_all_items(from_pane: &View<Pane>, to_pane: &View<Pane>, cx: &mut WindowContext) {
|
||||
let destination_is_different = from_pane != to_pane;
|
||||
let mut moved_items = 0;
|
||||
for (item_ix, item_handle) in from_pane
|
||||
|
@ -6195,7 +6187,7 @@ pub fn move_item(
|
|||
destination: &View<Pane>,
|
||||
item_id_to_move: EntityId,
|
||||
destination_index: usize,
|
||||
cx: &mut WindowContext<'_>,
|
||||
cx: &mut WindowContext,
|
||||
) {
|
||||
let Some((item_ix, item_handle)) = source
|
||||
.read(cx)
|
||||
|
@ -6227,7 +6219,7 @@ pub fn move_active_item(
|
|||
destination: &View<Pane>,
|
||||
focus_destination: bool,
|
||||
close_if_empty: bool,
|
||||
cx: &mut WindowContext<'_>,
|
||||
cx: &mut WindowContext,
|
||||
) {
|
||||
if source == destination {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue