[gnome-maps/wip/notifications2: 10/14] MainWindow: move the zoomcontrol to here
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/notifications2: 10/14] MainWindow: move the zoomcontrol to here
- Date: Mon, 17 Feb 2014 00:30:58 +0000 (UTC)
commit b43f75e707206a3c807d64ba70c9cc867f9a5616
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 | 6 ++++--
src/mapView.js | 5 +----
2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 12a8ad7..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;
@@ -62,13 +63,12 @@ const MainWindow = new Lang.Class({
'window-content',
'search-entry',
'search-completion']);
- let grid = ui.windowContent;
this._searchEntry = ui.searchEntry;
this._searchCompletion = ui.searchCompletion;
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 +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]