GNOME Bugzilla – Bug 641881
Slide workspaces thumbnails in/out
Last modified: 2011-02-18 16:37:48 UTC
The motion mockup in http://jimmac.musichall.cz/log/?p=1107 show workspace thumbnails sliding in rather than appearing abruptly. Would be nice to implement that. Exact details of the animation would have to be figured out with the new automatic workspace management - if you remove the last window from a workspace in the middle, does the workspace slide out first, then the gap left behind collapse? If you drag something onto the last empty workspace, do we want to animate a new workspace appearing before the end and the window appearing on that new workspace, or a new workspace appearing at the end after the already existing one.
Created attachment 180735 [details] [review] Animate scale changes to workspace thumbnails When we change the overall scale of the workspace thumbnail container, instead of doing it abruptly, animate the transition.
Created attachment 180736 [details] [review] Slide workspace thumbnails in when added and out when removed To explain to the user what is happening, instead of abruptly changing updating the workspace thumbnail list, slide thubmnails in and out as they are added and removed. To implement this, we track a state for each thumbnail and when things change go through a process of first sliding removed thumbnails out, then ollapsing the left-over spaces and rescaling the thumbnails, then finally sliding newly added thumbnails in.
Created attachment 180737 [details] [review] Fix background to animate with thumbnails When we animating the scale for the thumbnails, the border and background should wrap around the current size of the thumbails. The technique that we are using to animate the scale breaks that since we don't animate the overall size of the thumbnails box - we just animate our child actors within the allocation. To fix this, switch from drawing the background by packing in another container to drawing the background with a separate actor that is under the other actors and allocated by our custom logic.
Created attachment 180738 [details] [review] Animate workspace indicator before adding/removing workspaces Rather than killing the workspace indicator indicator when we remove workspaces because the source and target locations might have changed, do it as a separate first step. This provides a better explanation than doing it simultaneously with the addition/removal or not at all and also keeps our computations simple.
Created attachment 180739 [details] [review] Fix position of indicator while tweening Because the overall parent allocation width immediately when the workspace count changes, we were sometimes drawing the indicator in the wrong place in the indicator animation that proceeded the remove-workspace animation. Fix this by tweening only the Y position of the indicator and computing the X position and size in our allocate() method. This also is considerably simpler than switching the indicator between fixed position and geometry managed.
Review of attachment 180735 [details] [review]: Looks good.
Review of attachment 180736 [details] [review]: Mostly good. Fixing the animations for RTL locales looks easy, so I suggest doing it here. The "wiggling" is probably harder to fix, so we could ignore that now and fix it later. ::: js/ui/workspaceThumbnail.js @@ +663,3 @@ let thumbnailHeight = screenHeight * this._scale; + let thumbnailWidth = Math.round(screenWidth * this._scale); + let rightPadding = this.actor.get_theme_node().get_padding(St.Side.RIGHT); For RTL locales, leftPadding should be used. @@ +678,2 @@ if (i > 0) + y += (1 - thumbnail.collapseFraction) * spacing; Mmmh, tweaning collapseFraction results in roundedScale being instable between invocations of _allocate, making thumbnails "wiggle" when sliding up. It's not too obvious at normal speed, but still noticable. @@ +687,3 @@ let thisScale = (y2 - y1) / screenHeight; + let x1 = box.x2 - thumbnailWidth + slideWidth * thumbnail.slidePosition; Should be .. - slideWidth * thumbnail.slidePosition for RTL locales. @@ +740,1 @@ let active = global.screen.get_active_workspace_index(); Unused variable.
Review of attachment 180737 [details] [review]: Looks good. ::: data/theme/gnome-shell.css @@ +268,1 @@ border: 1px solid #424242; Should eventually use the same colors as the dash, but doesn't really fit in this commit ...
Review of attachment 180738 [details] [review]: OK. (The indicator's position is clearly wrong during the animation, but fixed in a follow-up patch)
Review of attachment 180739 [details] [review]: Looks good. Might be worth squasing with the previous commit, your call
*** Bug 642645 has been marked as a duplicate of this bug. ***
Created attachment 181220 [details] [review] Be more careful with workspace thumbnail scale - When tweening a workspace to collapse it, round the multiplied height so that we don't change other workspace sizes via rounding differences. - Use separate horizontal and vertical scales, so that every thumbnail has the same horizontal scale.
Review of attachment 181220 [details] [review]: Works nicely!
Attachment 180735 [details] pushed as aaf94ea - Animate scale changes to workspace thumbnails Attachment 180736 [details] pushed as 7598fd4 - Slide workspace thumbnails in when added and out when removed Attachment 180737 [details] pushed as 649ed33 - Fix background to animate with thumbnails Attachment 180738 [details] pushed as e9a4519 - Animate workspace indicator before adding/removing workspaces Attachment 180739 [details] pushed as 5351673 - Fix position of indicator while tweening Attachment 181220 [details] pushed as ef98348 - Be more careful with workspace thumbnail scale