From 0935ca72c9f6d2d0a8df816cc8973abc660e9630 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 23 Oct 2003 00:20:01 +0000 Subject: Add a little border to the buttons so it looks nicer. * e-sidebar.c (e_sidebar_add_button): Add a little border to the buttons so it looks nicer. * e-component-registry.c (query_components): Set an icon from the "evolution:button_icon" attribute. svn path=/trunk/; revision=23023 --- shell/ChangeLog | 8 ++++++++ shell/e-component-registry.c | 34 ++++++++++++++++++++++++++-------- shell/e-sidebar.c | 1 + 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index 9c5703383c..eef99c1fe6 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,11 @@ +2003-10-22 Ettore Perazzoli + + * e-sidebar.c (e_sidebar_add_button): Add a little border to the + buttons so it looks nicer. + + * e-component-registry.c (query_components): Set an icon from the + "evolution:button_icon" attribute. + 2003-10-22 Ettore Perazzoli * e-shell.c (struct _EShellPrivate): New member diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index 72ee37c334..e5e48aadc4 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -26,6 +26,8 @@ #include "e-component-registry.h" +#include "e-shell-utils.h" + #include "e-util/e-lang-utils.h" #include @@ -113,22 +115,38 @@ query_components (EComponentRegistry *registry) language_list = e_get_language_list (); for (i = 0; i < info_list->_length; i++) { - const char *id = info_list->_buffer[i].iid; - const char *label = bonobo_server_info_prop_lookup (& info_list->_buffer[i], - "evolution:button_label", - language_list); - const char *sort_order_string = bonobo_server_info_prop_lookup (& info_list->_buffer[i], - "evolution:button_sort_order", - NULL); + const char *id; + const char *label; + const char *icon_name; + const char *sort_order_string; + GdkPixbuf *icon; int sort_order; + id = info_list->_buffer[i].iid; + label = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_label", language_list); + + icon_name = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_icon", NULL); + if (icon_name == NULL) { + icon = NULL; + g_print ("no icon for %s\n", id); + } else { + char *full_path = e_shell_get_icon_path (icon_name, TRUE); + g_print ("icon %s\n", full_path); + icon = gdk_pixbuf_new_from_file (full_path, NULL); + } + + sort_order_string = bonobo_server_info_prop_lookup (& info_list->_buffer[i], + "evolution:button_sort_order", NULL); if (sort_order_string == NULL) sort_order = 0; else sort_order = atoi (sort_order_string); registry->priv->infos = g_slist_prepend (registry->priv->infos, - component_info_new (id, label, sort_order, NULL)); + component_info_new (id, label, sort_order, icon)); + + if (icon != NULL) + g_object_unref (icon); } CORBA_free (info_list); diff --git a/shell/e-sidebar.c b/shell/e-sidebar.c index ce0a29325f..ca94de9a9a 100644 --- a/shell/e-sidebar.c +++ b/shell/e-sidebar.c @@ -409,6 +409,7 @@ e_sidebar_add_button (ESidebar *sidebar, g_signal_connect (button_widget, "toggled", G_CALLBACK (button_toggled_callback), sidebar); hbox = gtk_hbox_new (FALSE, 3); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 2); icon_widget = gtk_image_new_from_pixbuf (icon); label_widget = gtk_label_new (label); gtk_box_pack_start (GTK_BOX (hbox), icon_widget, FALSE, TRUE, 0); -- cgit v1.2.3