[gnome-maps/wip/completion: 3/4] PlaceListRow: Add type property



commit 9fd9c29143030150079a5a8b7e960af5c33167be
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]