[gnome-maps/wip/routing: 58/59] MainWindow: move Overlay to ui-file



commit 2d60e0b9c61c7268501ce55535d891daaf688bcb
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Mon Sep 23 03:40:10 2013 +0200

    MainWindow: move Overlay to ui-file
    
    Move the GtkOverlay to main-window.ui and remove the unnecessary GtkGrid.

 src/main-window.ui |    5 +----
 src/mainWindow.js  |   21 +++++++--------------
 src/mapView.js     |    2 +-
 3 files changed, 9 insertions(+), 19 deletions(-)
---
diff --git a/src/main-window.ui b/src/main-window.ui
index 6f5489c..f55c3e6 100644
--- a/src/main-window.ui
+++ b/src/main-window.ui
@@ -81,11 +81,8 @@
       </object>
     </child>
     <child>
-      <object class="GtkGrid" id="window-content">
+      <object class="GtkOverlay" id="window-content">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <child>
-        </child>
       </object>
     </child>
   </object>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 5fefede..e8ddc9e 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -61,35 +61,28 @@ const MainWindow = new Lang.Class({
         let ui = Utils.getUIObject('main-window', [ 'app-window',
                                                     'window-content',
                                                     'search-entry' ]);
-        let grid = ui.windowContent;
         this._searchEntry = ui.searchEntry;
         this.window = ui.appWindow;
         this.window.application = app;
 
-        this._mapOverlay = new Gtk.Overlay({ visible: true });
-        this.mapView = new MapView.MapView(this._mapOverlay);
-        this._mapOverlay.add(this.mapView);
-        this._mapOverlay.add_overlay(new ZoomControl.ZoomControl(this.mapView));
-
+        this.mapView = new MapView.MapView();
         this.mapView.gotoUserLocation(false);
-
+        this._searchPopup = new SearchPopup.SearchPopup(10);
         this._contextMenu = new ContextMenu.ContextMenu(this.mapView);
 
+        ui.windowContent.add(this.mapView);
+        ui.windowContent.add_overlay(this._searchPopup);
+        ui.windowContent.add_overlay(new ZoomControl.ZoomControl(this.mapView));
+
         this._initSearchWidgets();
         this._initActions();
         this._initSignals();
         this._restoreWindowGeometry();
 
-        this._mapOverlay.add_overlay(this._searchPopup);
-
-        grid.add(this._mapOverlay);
-
-        grid.show_all();
+        ui.windowContent.show_all();
     },
 
     _initSearchWidgets: function() {
-        this._searchPopup = new SearchPopup.SearchPopup(10);
-
         let model = new Gtk.ListStore();
         model.set_column_types([GdkPixbuf.Pixbuf,
                                 GObject.TYPE_STRING,
diff --git a/src/mapView.js b/src/mapView.js
index 658f6f0..c4b2ad6 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -57,7 +57,7 @@ const MapView = new Lang.Class({
     Name: 'MapView',
     Extends: GtkChamplain.Embed,
 
-    _init: function(overlay) {
+    _init: function() {
         this.parent();
 
         this.actor = this.get_view();


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