forge
Explore
Log in

Don't you dare go Hollow

Append _fit to animate_view_offset_to_column()

Browse files at this commit

077f22edd6e562e2cfed626afaedd095997eb013Ivan MolodetskikhParent: 4f7c330
src/layout/workspace.rsmodified+6 -6
@@ -428,7 +428,7 @@ impl<W: LayoutElement> Workspace<W> {
428 ));428 ));
429 }429 }
430 430
431- fn animate_view_offset_to_column(&mut self, current_x: i32, idx: usize) {431+ fn animate_view_offset_to_column_fit(&mut self, current_x: i32, idx: usize) {
432 let new_view_offset = self.compute_new_view_offset_for_column(current_x, idx);432 let new_view_offset = self.compute_new_view_offset_for_column(current_x, idx);
433 self.animate_view_offset(current_x, idx, new_view_offset);433 self.animate_view_offset(current_x, idx, new_view_offset);
434 }434 }
@@ -440,7 +440,7 @@ impl<W: LayoutElement> Workspace<W> {
440 440
441 let col = &self.columns[idx];441 let col = &self.columns[idx];
442 if col.is_fullscreen {442 if col.is_fullscreen {
443- self.animate_view_offset_to_column(current_x, idx);443+ self.animate_view_offset_to_column_fit(current_x, idx);
444 return;444 return;
445 }445 }
446 446
@@ -450,7 +450,7 @@ impl<W: LayoutElement> Workspace<W> {
450 // edge alignment by the usual positioning code, so there's no use in trying to center it450 // edge alignment by the usual positioning code, so there's no use in trying to center it
451 // here.451 // here.
452 if self.working_area.size.w <= width {452 if self.working_area.size.w <= width {
453- self.animate_view_offset_to_column(current_x, idx);453+ self.animate_view_offset_to_column_fit(current_x, idx);
454 return;454 return;
455 }455 }
456 456
@@ -493,12 +493,12 @@ impl<W: LayoutElement> Workspace<W> {
493 493
494 // If it fits together, do a normal animation, otherwise center the new column.494 // If it fits together, do a normal animation, otherwise center the new column.
495 if total_width <= self.working_area.size.w {495 if total_width <= self.working_area.size.w {
496- self.animate_view_offset_to_column(current_x, idx);496+ self.animate_view_offset_to_column_fit(current_x, idx);
497 } else {497 } else {
498 self.animate_view_offset_to_column_centered(current_x, idx);498 self.animate_view_offset_to_column_centered(current_x, idx);
499 }499 }
500 }500 }
501- CenterFocusedColumn::Never => self.animate_view_offset_to_column(current_x, idx),501+ CenterFocusedColumn::Never => self.animate_view_offset_to_column_fit(current_x, idx),
502 };502 };
503 503
504 self.active_column_idx = idx;504 self.active_column_idx = idx;
@@ -771,7 +771,7 @@ impl<W: LayoutElement> Workspace<W> {
771 // continuously resizing windows not look janky.771 // continuously resizing windows not look janky.
772 self.animate_view_offset_to_column_centered(current_x, idx);772 self.animate_view_offset_to_column_centered(current_x, idx);
773 } else {773 } else {
774- self.animate_view_offset_to_column(current_x, idx);774+ self.animate_view_offset_to_column_fit(current_x, idx);
775 }775 }
776 }776 }
777 }777 }