From 29252e90c642281aeaae41640acd6db450383624 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Mon, 27 Aug 2012 16:34:16 +0200 Subject: Indent application shortcuts This is done by setting their icon to the empty string, which IdoMenuItem interprets as "show a clear icon". --- src/ido-menu-item.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3