[gnome-builder] shellcmd: use terminal icon for commands



commit 644f39879b8054423e796a230bc75834975852ae
Author: Christian Hergert <chergert redhat com>
Date:   Tue Aug 6 23:44:57 2019 -0700

    shellcmd: use terminal icon for commands

 src/plugins/shellcmd/gbp-shellcmd-command.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/plugins/shellcmd/gbp-shellcmd-command.c b/src/plugins/shellcmd/gbp-shellcmd-command.c
index 7d2e71857..3e3650db5 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-command.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-command.c
@@ -665,9 +665,24 @@ gbp_shellcmd_command_run_finish (IdeCommand    *command,
   return ide_task_propagate_boolean (IDE_TASK (result), error);
 }
 
+static GIcon *
+gbp_shellcmd_command_get_icon (IdeCommand *command)
+{
+  static GIcon *icon;
+
+  g_assert (IDE_IS_MAIN_THREAD ());
+  g_assert (GBP_IS_SHELLCMD_COMMAND (command));
+
+  if (icon == NULL)
+    icon = g_themed_icon_new ("utilities-terminal-symbolic");
+
+  return g_object_ref (icon);
+}
+
 static void
 command_iface_init (IdeCommandInterface *iface)
 {
+  iface->get_icon = gbp_shellcmd_command_get_icon;
   iface->get_title = gbp_shellcmd_command_get_title;
   iface->get_subtitle = gbp_shellcmd_command_get_subtitle;
   iface->run_async = gbp_shellcmd_command_run_async;


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