[gnome-maps] mapView: don't use a custom GtkClutterEmbed



commit 299e091217624d8f46fb9dc63409a03ef2cf722f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Apr 8 12:43:52 2013 -0400

    mapView: don't use a custom GtkClutterEmbed
    
    The ChamplainView already provides methods to pack an overlay actor
    inside its ClutterBinLayout.

 src/Makefile-js.am  |    1 -
 src/mainWindow.js   |    8 +--
 src/mapView.js      |   12 +++++-
 src/mapViewEmbed.js |  118 ---------------------------------------------------
 4 files changed, 14 insertions(+), 125 deletions(-)
---
diff --git a/src/Makefile-js.am b/src/Makefile-js.am
index bf9bc19..d80eaa4 100644
--- a/src/Makefile-js.am
+++ b/src/Makefile-js.am
@@ -4,7 +4,6 @@ dist_js_DATA = \
     main.js \
     mainWindow.js \
     mapView.js \
-    mapViewEmbed.js \
     path.js \
     properties.js \
     utils.js
diff --git a/src/mainWindow.js b/src/mainWindow.js
index e15e153..28863bd 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -30,7 +30,7 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 
 const Application = imports.application;
-const MapViewEmbed = imports.mapViewEmbed;
+const MapView = imports.mapView;
 const Utils = imports.utils;
 const Config = imports.config;
 
@@ -98,10 +98,8 @@ const MainWindow = new Lang.Class({
 
         grid.add(headerBar);
 
-        this._embed = new MapViewEmbed.MapViewEmbed();
-        grid.add(this._embed);
-
-        this.mapView = this._embed.mapView;
+        this.mapView = new MapView.MapView();
+        grid.add(this.mapView);
 
         grid.show_all();
     },
diff --git a/src/mapView.js b/src/mapView.js
index fe5ecef..d84800d 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -18,9 +18,11 @@
  * Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
  */
 
+const Clutter = imports.gi.Clutter;
 const Gdk = imports.gi.Gdk;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
+const GtkChamplain = imports.gi.GtkChamplain;
 const Champlain = imports.gi.Champlain;
 const Geocode = imports.gi.GeocodeGlib;
 
@@ -28,6 +30,7 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 
 const Application = imports.application;
+const Properties = imports.properties;
 const Utils = imports.utils;
 const _ = imports.gettext.gettext;
 
@@ -41,12 +44,19 @@ const MapType = {
 
 const MapView = new Lang.Class({
     Name: 'MapView',
+    Extends: GtkChamplain.Embed,
 
     _init: function(app) {
-        this.actor = new Champlain.View();
+        this.parent();
 
+        this.actor = this.get_view();
         this._view = this.actor;
 
+        this._properties = new Properties.Properties(this);
+        this._view.bin_layout_add(this._properties.actor,
+                                  Clutter.BinAlignment.FILL,
+                                  Clutter.BinAlignment.FILL);
+
         this._markerLayer = new Champlain.MarkerLayer();
         this._markerLayer.set_selection_mode(Champlain.SelectionMode.SINGLE);
         this._view.add_layer(this._markerLayer);


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