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> {
428428 ));
429429 }
430430
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) {
432432 let new_view_offset = self.compute_new_view_offset_for_column(current_x, idx);
433433 self.animate_view_offset(current_x, idx, new_view_offset);
434434 }
@@ -440,7 +440,7 @@ impl<W: LayoutElement> Workspace<W> {
440440
441441 let col = &self.columns[idx];
442442 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);
444444 return;
445445 }
446446
@@ -450,7 +450,7 @@ impl<W: LayoutElement> Workspace<W> {
450450 // edge alignment by the usual positioning code, so there's no use in trying to center it
451451 // here.
452452 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);
454454 return;
455455 }
456456
@@ -493,12 +493,12 @@ impl<W: LayoutElement> Workspace<W> {
493493
494494 // If it fits together, do a normal animation, otherwise center the new column.
495495 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);
497497 } else {
498498 self.animate_view_offset_to_column_centered(current_x, idx);
499499 }
500500 }
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),
502502 };
503503
504504 self.active_column_idx = idx;
@@ -771,7 +771,7 @@ impl<W: LayoutElement> Workspace<W> {
771771 // continuously resizing windows not look janky.
772772 self.animate_view_offset_to_column_centered(current_x, idx);
773773 } else {
774- self.animate_view_offset_to_column(current_x, idx);
774+ self.animate_view_offset_to_column_fit(current_x, idx);
775775 }
776776 }
777777 }