[gnome-maps/wip/move-2-overlay: 1/2] ZoomControl: init in mainWindow instead



commit cabb7b3229c7adddf3b8e9f70f5a136eb3c1f0d3
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Mon Sep 23 02:46:14 2013 +0200

    ZoomControl: init in mainWindow instead
    
    Move initialization of ZoomControl to mainWindow.js. It gets easier to
    work with GActions and signals if the different widgets are all glued
    together in mainWindow.

 src/mainWindow.js |    2 ++
 src/mapView.js    |    4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 742d543..ba9224e 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;
 
@@ -71,6 +72,7 @@ const MainWindow = new Lang.Class({
         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.gotoUserLocation(false);
 
diff --git a/src/mapView.js b/src/mapView.js
index aae8d7b..e6c5303 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;
@@ -91,9 +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();
         this.geoclue.connect("location-changed",


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