[gnome-maps/wip/completion: 1/3] placeListRow: Add type property



commit 3e716b5f399c5ae637c4ed7df6d5eaf6e1165c36
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Mon Nov 24 03:51:52 2014 -0500

    placeListRow: Add type property
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739036

 src/placeListRow.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/placeListRow.js b/src/placeListRow.js
index a758213..7966189 100644
--- a/src/placeListRow.js
+++ b/src/placeListRow.js
@@ -23,6 +23,7 @@ const Gtk = imports.gi.Gtk;
 const Lang = imports.lang;
 
 const PlaceFormatter = imports.placeFormatter;
+const PlaceStore = imports.placeStore;
 
 const ROW_HEIGHT = 50;
 
@@ -32,7 +33,8 @@ const PlaceListRow = new Lang.Class({
     Template: 'resource:///org/gnome/maps/place-list-row.ui',
     InternalChildren: [ 'icon',
                         'name',
-                        'details' ],
+                        'details',
+                        'typeIcon' ],
 
     _init: function(params) {
         this.place = params.place;
@@ -44,6 +46,9 @@ const PlaceListRow = new Lang.Class({
         let maxChars = params.maxChars || 40;
         delete params.maxChars;
 
+        let type = params.type;
+        delete params.type;
+
         params.height_request = ROW_HEIGHT;
         this.parent(params);
 
@@ -55,6 +60,11 @@ const PlaceListRow = new Lang.Class({
         this._details.max_width_chars = maxChars;
         this._details.label = formatter.getDetailsString();
         this._icon.gicon = this.place.icon;
+
+        if (type === PlaceStore.PlaceType.RECENT)
+            this._typeIcon.icon_name = 'document-open-recent-symbolic';
+        else if (type === PlaceStore.PlaceType.FAVORITE)
+            this._typeIcon.icon_name = 'emblem-favorite-symbolic';
     },
 
     _boldMatch: function(title, string) {


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