[gnome-maps] Have sidebar push the map on reveal



commit 09becd6f8d105193c07bd0f107d2e8bf9116c571
Author: Damián Nohales <damiannohales gmail com>
Date:   Mon Aug 18 19:17:39 2014 -0300

    Have sidebar push the map on reveal
    
    This avoids cuts of visible parts of the map and helps to
    implement better GtkPopover positioning over the map view.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722871

 src/main-window.ui  |    6 ++++++
 src/mainWindow.js   |   10 ++++++----
 src/notification.ui |    2 +-
 src/sidebar.js      |    1 -
 src/sidebar.ui      |    4 ++--
 5 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/src/main-window.ui b/src/main-window.ui
index b46933c..2bfc8b5 100644
--- a/src/main-window.ui
+++ b/src/main-window.ui
@@ -75,5 +75,11 @@
         </child>
       </object>
     </child>
+    <child>
+      <object class="GtkGrid" id="grid">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
   </object>
 </interface>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 9f1448b..4eb2774 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -54,20 +54,18 @@ const MainWindow = new Lang.Class({
         this._configureId = 0;
         let ui = Utils.getUIObject('main-window', [ 'app-window',
                                                     'header-bar',
+                                                    'grid',
                                                     'layers-button']);
         this.window = ui.appWindow;
         this.window.application = app;
         this._overlay = overlay;
 
-        ui.appWindow.add(this._overlay);
-
         this.mapView = new MapView.MapView();
         overlay.add(this.mapView);
 
         this.mapView.gotoUserLocation(false);
 
         this._sidebar = new Sidebar.Sidebar(this.mapView);
-        overlay.add_overlay(this._sidebar);
         Application.routeService.route.connect('update',
                                                this._setRevealSidebar.bind(this, true));
 
@@ -84,7 +82,11 @@ const MainWindow = new Lang.Class({
         this._restoreWindowGeometry();
 
         this._overlay.add_overlay(new ZoomControl.ZoomControl(this.mapView));
-        this._overlay.show_all();
+
+        ui.grid.attach(this._overlay, 0, 0, 1, 1);
+        ui.grid.attach(this._sidebar, 1, 0, 1, 1);
+
+        ui.grid.show_all();
     },
 
     _createPlaceEntry: function() {
diff --git a/src/notification.ui b/src/notification.ui
index 1a96559..eac5826 100644
--- a/src/notification.ui
+++ b/src/notification.ui
@@ -11,7 +11,7 @@
         <property name="visible">True</property>
         <property name="margin-start">10</property>
         <property name="margin-end">10</property>
-        <property name="width_request">600</property>
+        <property name="width_request">475</property>
         <property name="height_request">33</property>
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
diff --git a/src/sidebar.js b/src/sidebar.js
index f4f4a52..8ac964e 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -98,7 +98,6 @@ const Sidebar = new Lang.Class({
 
     _createEntry: function(propName, mapView) {
         let entry = new PlaceEntry.PlaceEntry({ visible: true,
-                                                hexpand: true,
                                                 mapView: mapView });
         entry.bind_property("place",
                             Application.routeService.query, propName,
diff --git a/src/sidebar.ui b/src/sidebar.ui
index 0aa85bc..49d6da6 100644
--- a/src/sidebar.ui
+++ b/src/sidebar.ui
@@ -8,6 +8,7 @@
     <property name="can_focus">False</property>
     <property name="vexpand">True</property>
     <property name="valign">fill</property>
+    <property name="column_homogeneous">True</property>
     <property name="orientation">vertical</property>
     <property name="width_request">250</property>
     <property name="row_spacing">12</property>
@@ -160,8 +161,7 @@
       </object>
       <packing>
         <property name="left_attach">0</property>
-        <property name="top_attach">3</property>
-        <property name="width">2</property>
+        <property name="top_attach">1</property>
       </packing>
     </child>
   </object>


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