aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-23 18:26:25 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-23 18:26:25 -0500
commitf6ab8644d81f403b0264e126e9631a00dd578418 (patch)
treea9986156f2c3495ce4a3b31f8c39875aa6fe35fb
parent4fc1900d906c3c2228279c2e00754a687a38e0d0 (diff)
downloadayatana-indicator-session-f6ab8644d81f403b0264e126e9631a00dd578418.tar.gz
ayatana-indicator-session-f6ab8644d81f403b0264e126e9631a00dd578418.tar.bz2
ayatana-indicator-session-f6ab8644d81f403b0264e126e9631a00dd578418.zip
add icon support to user menuitems
-rw-r--r--src/service.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index 4a62bd1..ede3a9f 100644
--- a/src/service.c
+++ b/src/service.c
@@ -498,6 +498,16 @@ create_switch_section (IndicatorSessionService * self)
item = g_menu_item_new (u->real_name, NULL);
g_menu_item_set_action_and_target (item, "indicator.switch-to-user", "s", u->user_name);
g_menu_item_set_attribute (item, "x-canonical-type", "s", "indicator.user-menu-item");
+
+ if (u->icon_file != NULL)
+ {
+ GFile * file = g_file_new_for_path (u->icon_file);
+ GIcon * icon = g_file_icon_new (file);
+ g_menu_item_set_attribute_value (item, G_MENU_ATTRIBUTE_ICON, g_icon_serialize (icon));
+ g_clear_object (&icon);
+ g_clear_object (&file);
+ }
+
g_menu_append_item (menu, item);
g_object_unref (item);
}