forge
Explore
Log in

Don't you dare go Hollow

layout: Synchronize unfullscreen view movement anim to resize

Browse files at this commit

9b52465e429f64fcdab091d428ff3a01def35ca1Ivan MolodetskikhParent: 7d60231
Before this commit, maximize/fullscreen was synchronized, but
unmaximize/unfullscreen wasn't.
src/layout/scrolling.rsmodified+5 -5
@@ -1386,11 +1386,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
1386 // We might need to move the view to ensure the resized window is still visible. But1386 // We might need to move the view to ensure the resized window is still visible. But
1387 // only do it when the view isn't frozen by an interactive resize or a view gesture.1387 // only do it when the view isn't frozen by an interactive resize or a view gesture.
1388 if self.interactive_resize.is_none() && !self.view_offset.is_gesture() {1388 if self.interactive_resize.is_none() && !self.view_offset.is_gesture() {
1389- // Restore the view offset upon unfullscreening if needed.
1390- if let Some(prev_offset) = unfullscreen_offset {
1391- self.animate_view_offset(col_idx, prev_offset);
1392- }
1393-
1394 // Synchronize the horizontal view movement with the resize so that it looks nice.1389 // Synchronize the horizontal view movement with the resize so that it looks nice.
1395 // This is especially important for always-centered view.1390 // This is especially important for always-centered view.
1396 let config = if ongoing_resize_anim {1391 let config = if ongoing_resize_anim {
@@ -1399,6 +1394,11 @@ impl<W: LayoutElement> ScrollingSpace<W> {
1399 self.options.animations.horizontal_view_movement.01394 self.options.animations.horizontal_view_movement.0
1400 };1395 };
1401 1396
1397+ // Restore the view offset upon unfullscreening if needed.
1398+ if let Some(prev_offset) = unfullscreen_offset {
1399+ self.animate_view_offset_with_config(col_idx, prev_offset, config);
1400+ }
1401+
1402 // FIXME: we will want to skip the animation in some cases here to make continuously1402 // FIXME: we will want to skip the animation in some cases here to make continuously
1403 // resizing windows not look janky.1403 // resizing windows not look janky.
1404 self.animate_view_offset_to_column_with_config(None, col_idx, None, config);1404 self.animate_view_offset_to_column_with_config(None, col_idx, None, config);