[gnome-maps/wip/routing: 57/59] ZoomControl: init in mainWindow instead



commit 4533d7ee4c6ec26ee5f6fbc1f4106ced133bdea3
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 034a57d..5fefede 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -37,6 +37,7 @@ const SearchPopup = imports.searchPopup;
 const ContextMenu = imports.contextMenu;
 const Utils = imports.utils;
 const Config = imports.config;
+const ZoomControl = imports.zoomControl;
 
 const _ = imports.gettext.gettext;
 
@@ -68,6 +69,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 9733840..658f6f0 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;
@@ -97,9 +96,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]