[gnome-maps/wip/move-2-overlay] MainWindow: move Overlay to ui-file



commit f403aefdf1ae2b7e380f15c0053247c49a5c666e
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  |   15 +++++----------
 src/mapView.js     |    2 +-
 3 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/src/main-window.ui b/src/main-window.ui
index ac50e0c..8375d51 100644
--- a/src/main-window.ui
+++ b/src/main-window.ui
@@ -101,11 +101,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 ba9224e..19aba73 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -69,26 +69,21 @@ const MainWindow = new Lang.Class({
         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._contextMenu = new ContextMenu.ContextMenu(this.mapView);
 
         this._initPlaces();
+        ui.windowContent.add(this.mapView);
+        ui.windowContent.add_overlay(this._searchPopup);
+
         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();
     },
 
     _initPlaces: function() {
diff --git a/src/mapView.js b/src/mapView.js
index e6c5303..7823519 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -55,7 +55,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]