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



commit 8de2a296fb54f084525f151007fd23467a86a0c8
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  |   14 +++++---------
 src/mapView.js     |    2 +-
 3 files changed, 7 insertions(+), 14 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..45689b0 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -69,11 +69,7 @@ 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);
@@ -84,11 +80,11 @@ const MainWindow = new Lang.Class({
         this._initSignals();
         this._restoreWindowGeometry();
 
-        this._mapOverlay.add_overlay(this._searchPopup);
-
-        grid.add(this._mapOverlay);
+        ui.windowContent.add(this.mapView);
+        ui.windowContent.add_overlay(this._searchPopup);
+        ui.windowContent.add_overlay(new ZoomControl.ZoomControl(this.mapView));
 
-        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]