diff --git a/panel.js b/panel.js index df074ae..defa32e 100644 --- a/panel.js +++ b/panel.js @@ -164,17 +164,6 @@ var dtpPanel = Utils.defineClass({ this.panel.add_child(this._leftBox); this.panel.add_child(this._centerBox); this.panel.add_child(this._rightBox); - - if (position == St.Side.TOP) { - this.panel._leftCorner = new Panel.PanelCorner(St.Side.LEFT); - this.panel._rightCorner = new Panel.PanelCorner(St.Side.RIGHT); - - Utils.wrapActor(this.panel._leftCorner); - Utils.wrapActor(this.panel._rightCorner); - - this.panel.add_child(this.panel._leftCorner.actor); - this.panel.add_child(this.panel._rightCorner.actor); - } } else { this.panel = Main.panel; this.statusArea = Main.panel.statusArea; @@ -186,6 +175,20 @@ var dtpPanel = Utils.defineClass({ } this.panel.actor._delegate = this; + + if (position == St.Side.TOP) { + this.panel._leftCorner = this.panel._leftCorner || new Panel.PanelCorner(St.Side.LEFT); + this.panel._rightCorner = this.panel._rightCorner || new Panel.PanelCorner(St.Side.RIGHT); + + Utils.wrapActor(this.panel._leftCorner); + Utils.wrapActor(this.panel._rightCorner); + + if (isSecondary) { + this.panel.add_child(this.panel._leftCorner.actor); + this.panel.add_child(this.panel._rightCorner.actor); + } + } + this.add_child(this.panel.actor); if (Main.panel._onButtonPress) { diff --git a/transparency.js b/transparency.js index 5230c87..c46562c 100644 --- a/transparency.js +++ b/transparency.js @@ -39,7 +39,7 @@ var DynamicTransparency = Utils.defineClass({ this._initialPanelStyle = dtpPanel.panel.actor.get_style(); - if (this._dtpPanel.panel._leftCorner) { + if (this._dtpPanel.geom.position == St.Side.TOP) { this._initialPanelCornerStyle = dtpPanel.panel._leftCorner.actor.get_style(); } @@ -57,7 +57,7 @@ var DynamicTransparency = Utils.defineClass({ this._dtpPanel.panel.actor.set_style(this._initialPanelStyle); - if (this._dtpPanel.panel._leftCorner) { + if (this._dtpPanel.geom.position == St.Side.TOP) { this._dtpPanel.panel._leftCorner.actor.set_style(this._initialPanelCornerStyle); this._dtpPanel.panel._rightCorner.actor.set_style(this._initialPanelCornerStyle); } @@ -217,7 +217,7 @@ var DynamicTransparency = Utils.defineClass({ this._dtpPanel.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles); - if (this._dtpPanel.panel._leftCorner) { + if (this._dtpPanel.geom.position == St.Side.TOP) { this._dtpPanel.panel._leftCorner.actor.set_style(cornerStyle); this._dtpPanel.panel._rightCorner.actor.set_style(cornerStyle); }