[gnome-shell/wip/message-tray: 2/19] layout: Provide a method to toggle the panel struts



commit 824d7ea8cb13ac6ab2c3601680ce864a9ec86acb
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jul 18 17:17:47 2012 +0200

    layout: Provide a method to toggle the panel struts
    
    We need to toggle the panel struts while toggling the message tray so
    that windows can be moved up beneath the panel.
    
    Fixes: https://bugzilla.gnome.org/677215

 js/ui/layout.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index a4da201..5f58ff9 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -366,6 +366,10 @@ const LayoutManager = new Lang.Class({
         this._chrome.removeActor(actor);
     },
 
+    togglePanelStruts: function() {
+        this._chrome.toggleStruts(this.panelBox);
+    },
+
     findMonitorForActor: function(actor) {
         return this._chrome.findMonitorForActor(actor);
     }
@@ -628,6 +632,15 @@ const Chrome = new Lang.Class({
         this._untrackActor(actor);
     },
 
+    toggleStruts: function(actor) {
+        let index = this._findActor(actor);
+        if (index == -1)
+            return;
+
+        let actorData = this._trackedActors[index];
+        actorData.affectsStruts = !actorData.affectsStruts;
+    },
+
     _findActor: function(actor) {
         for (let i = 0; i < this._trackedActors.length; i++) {
             let actorData = this._trackedActors[i];



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