After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641881 - Slide workspaces thumbnails in/out
Slide workspaces thumbnails in/out
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Florian Müllner
gnome-shell-maint
: 642645 (view as bug list)
Depends on: 641879 641880 642192 642672
Blocks:
 
 
Reported: 2011-02-08 23:21 UTC by Owen Taylor
Modified: 2011-02-18 16:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Animate scale changes to workspace thumbnails (4.77 KB, patch)
2011-02-12 21:39 UTC, Owen Taylor
committed Details | Review
Slide workspace thumbnails in when added and out when removed (17.77 KB, patch)
2011-02-12 21:40 UTC, Owen Taylor
committed Details | Review
Fix background to animate with thumbnails (8.00 KB, patch)
2011-02-12 21:40 UTC, Owen Taylor
committed Details | Review
Animate workspace indicator before adding/removing workspaces (3.40 KB, patch)
2011-02-12 21:40 UTC, Owen Taylor
committed Details | Review
Fix position of indicator while tweening (6.50 KB, patch)
2011-02-12 21:40 UTC, Owen Taylor
committed Details | Review
Be more careful with workspace thumbnail scale (2.70 KB, patch)
2011-02-18 15:34 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2011-02-08 23:21:18 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.
Comment 1 Owen Taylor 2011-02-12 21:39:58 UTC
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.
Comment 2 Owen Taylor 2011-02-12 21:40:01 UTC
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.
Comment 3 Owen Taylor 2011-02-12 21:40:04 UTC
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.
Comment 4 Owen Taylor 2011-02-12 21:40:07 UTC
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.
Comment 5 Owen Taylor 2011-02-12 21:40:10 UTC
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.
Comment 6 Florian Müllner 2011-02-17 16:58:35 UTC
Review of attachment 180735 [details] [review]:

Looks good.
Comment 7 Florian Müllner 2011-02-17 19:38:51 UTC
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.
Comment 8 Florian Müllner 2011-02-17 19:41:07 UTC
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 ...
Comment 9 Florian Müllner 2011-02-17 19:41:33 UTC
Review of attachment 180738 [details] [review]:

OK. (The indicator's position is clearly wrong during the animation, but fixed in a follow-up patch)
Comment 10 Florian Müllner 2011-02-17 19:42:03 UTC
Review of attachment 180739 [details] [review]:

Looks good. Might be worth squasing with the previous commit, your call
Comment 11 Florian Müllner 2011-02-18 06:49:55 UTC
*** Bug 642645 has been marked as a duplicate of this bug. ***
Comment 12 Owen Taylor 2011-02-18 15:34:36 UTC
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.
Comment 13 Florian Müllner 2011-02-18 16:09:13 UTC
Review of attachment 181220 [details] [review]:

Works nicely!
Comment 14 Owen Taylor 2011-02-18 16:37:22 UTC
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