[gnome-shell] legacyTray: Temporarily reveal tray when icons are added



commit 594a227bc14ee235bb0f892c1e0e9195618946ea
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Apr 14 18:24:44 2015 +0200

    legacyTray: Temporarily reveal tray when icons are added
    
    There is a balance to hit between discoverability and getting out
    of the way, and the legacy tray currently fails in both regards.
    To address the first issue, temporarily reveal the tray when a
    new icon is added.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746025

 js/ui/legacyTray.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/legacyTray.js b/js/ui/legacyTray.js
index 821dd9d..b97fd48 100644
--- a/js/ui/legacyTray.js
+++ b/js/ui/legacyTray.js
@@ -1,4 +1,5 @@
 const Clutter = imports.gi.Clutter;
+const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const Meta = imports.gi.Meta;
 const Shell = imports.gi.Shell;
@@ -30,6 +31,7 @@ const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
 // Offset of the original position from the bottom-right corner
 const CONCEALED_VISIBLE_FRACTION = 0.2;
 const REVEAL_ANIMATION_TIME = 0.2;
+const TEMP_REVEAL_TIME = 2;
 
 const BARRIER_THRESHOLD = 70;
 const BARRIER_TIMEOUT = 1000;
@@ -174,7 +176,15 @@ const LegacyTray = new Lang.Class({
             }));
 
         this._iconBox.add_actor(button);
-        this._sync();
+
+        if (!this._concealHandle.visible) {
+            this._concealHandle.show();
+            GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, TEMP_REVEAL_TIME,
+                Lang.bind(this, function() {
+                    this._concealHandle.hide();
+                    return GLib.SOURCE_REMOVE;
+                }));
+        }
     },
 
     _onTrayIconRemoved: function(tm, icon) {


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