[gnome-shell] view-selector: Don't fade in the initially selected tab



commit 06ea78af1bf9e9c4b9d7c99f7909dd16ac4905ea
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Mar 10 13:14:48 2011 +0100

    view-selector: Don't fade in the initially selected tab
    
    The fade effect when switching tabs should only be applied when
    switching from a previously selected tab, not when selecting the
    initial one - otherwise, the window previews are faded in the first
    time the overview is shown.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644389

 js/ui/viewSelector.js |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 6cb0596..35e7aae 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -41,11 +41,14 @@ BaseTab.prototype = {
         this.visible = false;
     },
 
-    show: function() {
+    show: function(animate) {
         this.visible = true;
-        this.page.opacity = 0;
         this.page.show();
 
+        if (!animate)
+            return;
+
+        this.page.opacity = 0;
         Tweener.addTween(this.page,
                          { opacity: 255,
                            time: 0.1,
@@ -393,6 +396,8 @@ ViewSelector.prototype = {
     },
 
     _switchTab: function(tab) {
+        let firstSwitch = this._activeTab == null;
+
         if (this._activeTab && this._activeTab.visible) {
             if (this._activeTab == tab)
                 return;
@@ -408,11 +413,13 @@ ViewSelector.prototype = {
             }
         }
 
+        // Only fade when switching between tabs,
+        // not when setting the initially selected one.
         if (!tab.visible)
-            tab.show();
+            tab.show(!firstSwitch);
 
         // Pull a Meg Ryan:
-        if (Main.overview && Main.overview.workspaces) {
+        if (!firstSwitch && Main.overview.workspaces) {
             if (tab != this._tabs[0]) {
                 Tweener.addTween(Main.overview.workspaces.actor,
                                  { opacity: 0,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]