[gnome-maps/wip/notifications: 2/4] MainWindow: move the zoomcontrol to here
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/notifications: 2/4] MainWindow: move the zoomcontrol to here
- Date: Mon, 10 Feb 2014 21:03:03 +0000 (UTC)
commit fd3197e7ca757dea571c9389ea191704e090340f
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 | 4 +++-
src/mapView.js | 5 +----
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 6788a6d..857bcef 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);
@@ -81,6 +82,7 @@ const MainWindow = new Lang.Class({
this._restoreWindowGeometry();
ui.windowContent.add_overlay(this._searchPopup);
+ 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]