[gnome-shell-extensions/wip/window-list: 6/14] Use notification counter instead of 'info' to raise message tray



commit 51038eb30354ccb424262b2efa7ff3ab0889842c
Author: Florian MÃllner <fmuellner gnome org>
Date:   Fri Jan 18 17:39:38 2013 +0100

    Use notification counter instead of 'info' to raise message tray

 extensions/window-list/extension.js   |   12 ++++++++----
 extensions/window-list/stylesheet.css |    4 ----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 81a2bfc..8f174bf 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -92,10 +92,13 @@ const TrayButton = new Lang.Class({
     Name: 'TrayButton',
 
     _init: function() {
-        let icon = new St.Icon({ icon_name: 'dialog-information-symbolic',
-                                 style_class: 'system-status-icon' });
-        this.actor = new St.Button({ style_class: 'tray-button',
-                                     child: icon });
+        this._counterLabel = new St.Label({ x_align: Clutter.ActorAlign.CENTER,
+                                            x_expand: true,
+                                            y_align: Clutter.ActorAlign.CENTER,
+                                            y_expand: true });
+        this.actor = new St.Button({ style_class: 'summary-source-counter',
+                                     child: this._counterLabel,
+                                     layoutManager: new Clutter.BinLayout() });
         this.actor.set_x_align(Clutter.ActorAlign.END);
         this.actor.set_x_expand(true);
         this.actor.set_y_expand(true);
@@ -133,6 +136,7 @@ const TrayButton = new Lang.Class({
     },
 
     _updateVisibility: function() {
+        this._counterLabel.text = this._trayItemCount.toString();
         this.actor.visible = this._trayItemCount > 0;
     },
 
diff --git a/extensions/window-list/stylesheet.css b/extensions/window-list/stylesheet.css
index d69a326..8802778 100644
--- a/extensions/window-list/stylesheet.css
+++ b/extensions/window-list/stylesheet.css
@@ -64,7 +64,3 @@
   width: 24px;
   height: 24px;
 }
-
-.tray-button {
-  padding: 1px 1px 1px 4px;
-}



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