overviewControls: Set expandFraction for ws thumbnails to 0 when hidden

We multiply the spacing around the workspace thumbnails with the
expandFraction so that it grows with the animation to show/hide them. We
shouldn't factor in the extra spacing to accomodate for the thumbnails in
case they're hidden though, so make sure expandFraction is set to 0 after
the thumbnails got hidden.

This fixes the spacing when a user never uses workspaces (and the workspace
thumbnails are never shown), and also the first transition from
hidden->shown for the thumbnails, which currently starts at 100% scale (ie.
pops into existence).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3278>
This commit is contained in:
Jonas Dreßler 2024-05-12 11:51:35 +02:00 committed by Marge Bot
parent 57d0691c3a
commit 9bf550da88

View File

@ -561,7 +561,10 @@ class ControlsManager extends St.Widget {
opacity: searchActive ? 0 : opacity,
duration: animate ? SIDE_CONTROLS_ANIMATION_TIME : 0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => (this._thumbnailsBox.visible = thumbnailsBoxVisible),
onComplete: () => {
this._thumbnailsBox.visible = thumbnailsBoxVisible;
this._thumbnailsBox.expandFraction = 0;
},
};
if (!searchActive) {