diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-08-27 16:34:16 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-08-27 16:34:16 +0200 |
commit | 29252e90c642281aeaae41640acd6db450383624 (patch) | |
tree | 65eb25747abb3efafab1746587267b51bb9f989f /src | |
parent | 5c88df7dcff3fcb98507a9b1c073bb5b23e1487d (diff) | |
download | ayatana-indicator-messages-29252e90c642281aeaae41640acd6db450383624.tar.gz ayatana-indicator-messages-29252e90c642281aeaae41640acd6db450383624.tar.bz2 ayatana-indicator-messages-29252e90c642281aeaae41640acd6db450383624.zip |
Indent application shortcuts
This is done by setting their icon to the empty string, which IdoMenuItem
interprets as "show a clear icon".
Diffstat (limited to 'src')
-rw-r--r-- | src/ido-menu-item.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ido-menu-item.c b/src/ido-menu-item.c index c2a8309..306d846 100644 --- a/src/ido-menu-item.c +++ b/src/ido-menu-item.c @@ -324,11 +324,22 @@ ido_menu_item_set_menu_item (IdoMenuItem *self, { GError *error; - icon = g_icon_new_for_string (iconstr, &error); - if (icon == NULL) + /* only indent the label if icon is set to "" */ + if (iconstr[0] == '\0') { - g_warning ("unable to set icon: %s", error->message); - g_error_free (error); + gint width; + + gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, NULL); + gtk_widget_set_size_request (self->priv->icon, width, -1); + } + else + { + icon = g_icon_new_for_string (iconstr, &error); + if (icon == NULL) + { + g_warning ("unable to set icon: %s", error->message); + g_error_free (error); + } } g_free (iconstr); } |