[gnome-maps] MainWindow: move the zoomcontrol to here



commit 84c5398fdf9767a1dcc3cfea29780b7914ab5213
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Wed Feb 5 16:11:41 2014 +0100

    MainWindow: move the zoomcontrol to here
    
    Initialize the zoom control outside of the mapView, just like the
    searchpopup.
    
    As a side effect this removes the circular dependency
    between the map overlay and the map view.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723996

 src/mainWindow.js |    5 ++++-
 src/mapView.js    |    5 +----
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index fa330a0..3f9fc96 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -38,6 +38,7 @@ const ContextMenu = imports.contextMenu;
 const PlaceStore = imports.placeStore;
 const Utils = imports.utils;
 const Config = imports.config;
+const ZoomControl = imports.zoomControl;
 
 const _ = imports.gettext.gettext;
 
@@ -67,7 +68,7 @@ const MainWindow = new Lang.Class({
         this.window = ui.appWindow;
         this.window.application = app;
 
-        this.mapView = new MapView.MapView(ui.windowContent);
+        this.mapView = new MapView.MapView();
         ui.windowContent.add(this.mapView);
 
         this.mapView.gotoUserLocation(false);
@@ -80,6 +81,8 @@ const MainWindow = new Lang.Class({
         this._initSignals();
         this._restoreWindowGeometry();
 
+        ui.windowContent.add_overlay(new ZoomControl.ZoomControl(this.mapView));
+
         ui.windowContent.show_all();
     },
 
diff --git a/src/mapView.js b/src/mapView.js
index 00d4a3e..99ac1d8 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -34,7 +34,6 @@ const Mainloop = imports.mainloop;
 const Signals = imports.signals;
 
 const Application = imports.application;
-const ZoomControl = imports.zoomControl;
 const Sidebar = imports.sidebar;
 const Utils = imports.utils;
 const Path = imports.path;
@@ -56,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();
@@ -91,8 +90,6 @@ const MapView = new Lang.Class({
         this._factory = Champlain.MapSourceFactory.dup_default();
         this.setMapType(MapType.STREET);
 
-        this._zoomControl = new ZoomControl.ZoomControl(this);
-        overlay.add_overlay(this._zoomControl);
 
         this.geoclue = new Geoclue.Geoclue();
         this._updateUserLocation();


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