[PATCH 1/2] position sidebar centerd on the left side of the primary monitor



---
 js/ui/sidebar.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/js/ui/sidebar.js b/js/ui/sidebar.js
index 9e2ebd3..5389f25 100644
--- a/js/ui/sidebar.js
+++ b/js/ui/sidebar.js
@@ -69,6 +69,8 @@ Sidebar.prototype = {
                             Lang.bind(this, this._expandedChanged));
         this._gconf.connect('changed::sidebar/visible',
                             Lang.bind(this, this._visibleChanged));
+
+        this._adjustPosition();
     },
 
     addWidget: function(widget) {
@@ -82,6 +84,14 @@ Sidebar.prototype = {
 
         this.box.append(widgetBox.actor, Big.BoxPackFlags.NONE);
         this._widgets.push(widgetBox);
+        this._adjustPosition();
+    },
+
+    _adjustPosition: function() {
+        let primary=global.get_primary_monitor();
+
+        this.actor.y = Math.max(primary.y + Panel.PANEL_HEIGHT,primary.height/2 - this.actor.height/2);
+        this.actor.x = primary.x;
     },
 
     _visibleChanged: function() {
-- 
1.6.5.3


--=-asl5sckQgXgHW69JxpmX
Content-Disposition: attachment; filename="0002-autohide-sidebar-in-compact-mode.patch"
Content-Type: text/x-patch; name="0002-autohide-sidebar-in-compact-mode.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



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