[gnome-maps] sendToDialog: Get icon-name from app info



commit dc1b2122d89f16dc94eb2d5218960932138ea718
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Mon Feb 29 20:10:29 2016 +0100

    sendToDialog: Get icon-name from app info

 data/ui/send-to-dialog.ui |    2 --
 src/sendToDialog.js       |   14 ++++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/send-to-dialog.ui b/data/ui/send-to-dialog.ui
index a0f1d7e..7ba4836 100644
--- a/data/ui/send-to-dialog.ui
+++ b/data/ui/send-to-dialog.ui
@@ -83,7 +83,6 @@
                             <child>
                               <object class="GtkImage" id="weatherIcon">
                                 <property name="visible">True</property>
-                                <property name="icon_name">org.gnome.Weather.Application</property>
                                 <property name="pixel_size">32</property>
                                 <property name="halign">start</property>
                               </object>
@@ -111,7 +110,6 @@
                             <child>
                               <object class="GtkImage" id="clocksIcon">
                                 <property name="visible">True</property>
-                                <property name="icon_name">gnome-clocks</property>
                                 <property name="pixel_size">32</property>
                                 <property name="halign">start</property>
                               </object>
diff --git a/src/sendToDialog.js b/src/sendToDialog.js
index 5f91973..fd8585b 100644
--- a/src/sendToDialog.js
+++ b/src/sendToDialog.js
@@ -44,8 +44,10 @@ const SendToDialog = new Lang.Class({
     InternalChildren: [ 'list',
                         'weatherRow',
                         'weatherLabel',
+                        'weatherIcon',
                         'clocksRow',
                         'clocksLabel',
+                        'clocksIcon',
                         'browserRow',
                         'browserLabel',
                         'browserIcon',
@@ -96,15 +98,19 @@ const SendToDialog = new Lang.Class({
         let appWeather = this._checkWeather(weatherInfo);
         let appClocks = this._checkClocks(clocksInfo);
 
-        if (!appWeather)
+        if (!appWeather) {
             this._weatherRow.hide();
-        else
+        } else {
             this._weatherLabel.label = weatherInfo.get_name();
+            this._weatherIcon.icon_name = weatherInfo.get_icon().to_string();
+        }
 
-        if (!appClocks)
+        if (!appClocks) {
             this._clocksRow.hide();
-        else
+        } else {
             this._clocksLabel.label = clocksInfo.get_name();
+            this._clocksIcon.icon_name = clocksInfo.get_icon().to_string();
+        }
 
         if (!browserInfo) {
             this._browserRow.hide();


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