[gnome-shell/eos3.8: 98/255] shell-app: Add new convenience function to get the app's icon, if any



commit 78cbc2624d06d98e4fd3c54e84123c8a8c30057a
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Tue Dec 5 16:19:46 2017 +0000

    shell-app: Add new convenience function to get the app's icon, if any
    
    This will be used by the next commit.
    
    https://phabricator.endlessm.com/T18012

 src/shell-app.c | 15 +++++++++++++++
 src/shell-app.h |  2 ++
 2 files changed, 17 insertions(+)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index e3adf084a5..9d9663d13d 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -291,6 +291,21 @@ shell_app_get_description (ShellApp *app)
     return NULL;
 }
 
+/**
+ * shell_app_get_icon:
+ * @app: a #ShellApp
+ *
+ * Returns: (transfer none): The #GIcon associated with this app, or %NULL if none is available.
+ */
+GIcon *
+shell_app_get_icon (ShellApp *app)
+{
+  if (app->info)
+    return g_app_info_get_icon (G_APP_INFO (app->info));
+  else
+    return NULL;
+}
+
 /**
  * shell_app_is_window_backed:
  *
diff --git a/src/shell-app.h b/src/shell-app.h
index 6c3f30f9eb..833c984c68 100644
--- a/src/shell-app.h
+++ b/src/shell-app.h
@@ -25,6 +25,8 @@ GDesktopAppInfo *shell_app_get_app_info (ShellApp *app);
 ClutterActor *shell_app_create_icon_texture (ShellApp *app, int size);
 const char *shell_app_get_name (ShellApp *app);
 const char *shell_app_get_description (ShellApp *app);
+GIcon *shell_app_get_icon (ShellApp *app);
+
 gboolean shell_app_is_window_backed (ShellApp *app);
 
 void shell_app_activate_window (ShellApp *app, MetaWindow *window, guint32 timestamp);


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