[gnome-shell] panel: pass the Panel object to the PanelCorners



commit ae35d0e43c1ba678bc26984a85eb10e4e5138a23
Author: Dan Winship <danw gnome org>
Date:   Tue Jun 28 09:20:38 2011 -0400

    panel: pass the Panel object to the PanelCorners
    
    rather than having them refer to it via Main.panel
    
    https://bugzilla.gnome.org/show_bug.cgi?id=636963

 js/ui/panel.js |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 7569f39..7df3e11 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -545,12 +545,13 @@ AppMenuButton.prototype = {
 Signals.addSignalMethods(AppMenuButton.prototype);
 
 
-function PanelCorner(side) {
-    this._init(side);
+function PanelCorner(panel, side) {
+    this._init(panel, side);
 }
 
 PanelCorner.prototype = {
-    _init: function(side) {
+    _init: function(panel, side) {
+        this._panel = panel;
         this._side = side;
         this.actor = new St.DrawingArea({ style_class: 'panel-corner' });
         this.actor.connect('repaint', Lang.bind(this, this._repaint));
@@ -626,11 +627,11 @@ PanelCorner.prototype = {
         this.actor.set_size(cornerRadius,
                             innerBorderWidth + cornerRadius);
         if (this._side == St.Side.LEFT)
-            this.actor.set_position(Main.panel.actor.x,
-                                    Main.panel.actor.y + Main.panel.actor.height - innerBorderWidth);
+            this.actor.set_position(this._panel.actor.x,
+                                    this._panel.actor.y + this._panel.actor.height - innerBorderWidth);
         else
-            this.actor.set_position(Main.panel.actor.x + Main.panel.actor.width - cornerRadius,
-                                    Main.panel.actor.y + Main.panel.actor.height - innerBorderWidth);
+            this.actor.set_position(this._panel.actor.x + this._panel.actor.width - cornerRadius,
+                                    this._panel.actor.y + this._panel.actor.height - innerBorderWidth);
     }
 };
 
@@ -834,8 +835,8 @@ Panel.prototype = {
         this._centerBox = new St.BoxLayout({ name: 'panelCenter' });
         this._rightBox = new St.BoxLayout({ name: 'panelRight' });
 
-        this._leftCorner = new PanelCorner(St.Side.LEFT);
-        this._rightCorner = new PanelCorner(St.Side.RIGHT);
+        this._leftCorner = new PanelCorner(this, St.Side.LEFT);
+        this._rightCorner = new PanelCorner(this, St.Side.RIGHT);
 
         /* This box container ensures that the centerBox is positioned in the *absolute*
          * center, but can be pushed aside if necessary. */



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