[gnome-maps/wip/osrm-routing: 18/21] OSRM: fill sidebar with directions



commit 7e27c5ecc7e4731d96baa509f7c666469f216c90
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Mon Jun 17 18:32:11 2013 +0200

    OSRM: fill sidebar with directions
    
    WIP! WIP! Start filling the Sidebar with route directions as fetched from
    OSRM.

 src/mapView.js |    2 +-
 src/sidebar.js |    9 +++++++++
 src/sidebar.ui |    3 +++
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index f6357e2..6c9e144 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -139,7 +139,7 @@ const MapView = new Lang.Class({
                     longitude: instruction.point.lon,
                     size: 8.0
                 }));
-                log(" * " + instruction.toString());
+                this._sidebar.addInstruction(instruction);
             }, this);
 
             this._routeLayer.visible = true;
diff --git a/src/sidebar.js b/src/sidebar.js
index 5bebd4f..13dc9ac 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -77,6 +77,15 @@ const Sidebar = new Lang.Class({
         return actor;
     },
 
+    addInstruction: function(instruction) {
+        this._ui.instructionsList.add(new Gtk.ListBoxRow({
+            child: new Gtk.Label({
+                label: instruction.toString()
+            })
+        }));
+        log(" * " + instruction.toString());
+    },
+
     reveal: function() {
         this._ui.revealer.reveal_child = true;
         this._ui.revealButton.symbolic_icon_name = 'go-next-symbolic';
diff --git a/src/sidebar.ui b/src/sidebar.ui
index 6efc28c..6d76265 100644
--- a/src/sidebar.ui
+++ b/src/sidebar.ui
@@ -173,5 +173,8 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="valign">center</property>
+       <style>
+         <class name="osd" />
+       </style>
   </object>
 </interface>


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