forge
Explore
Log in

Don't you dare go Hollow

layout: Preserve previous view offset on consume-left

Browse files at this commit

fd3b1f2b6c9117a6a52c8f452501559a7c5b2b6dIvan MolodetskikhParent: ee0e2c7
src/layout/scrolling.rsmodified+6 -2
@@ -1711,8 +1711,12 @@ impl<W: LayoutElement> ScrollingSpace<W> {
1711 1711
1712 if source_tile_was_active {1712 if source_tile_was_active {
1713 // Make sure the previous (target) column is activated so the animation looks right.1713 // Make sure the previous (target) column is activated so the animation looks right.
1714- self.activate_prev_column_on_removal =1714+ //
1715- Some(self.view_offset.stationary() + offset.x);1715+ // However, if it was already going to be activated, leave the offset as is. This
1716+ // improves the workflow that has become common with tabbed columns: open a new
1717+ // window, then immediately consume it left as a new tab.
1718+ self.activate_prev_column_on_removal
1719+ .get_or_insert(self.view_offset.stationary() + offset.x);
1716 }1720 }
1717 1721
1718 offset.x += self.columns[source_col_idx].render_offset().x;1722 offset.x += self.columns[source_col_idx].render_offset().x;