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
This commit is contained in:
Ettore Perazzoli
2003-10-23 00:20:01 +00:00
parent abb1418197
commit 0935ca72c9
3 changed files with 35 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2003-10-22 Ettore Perazzoli <ettore@ximian.com>
* 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 <ettore@ximian.com>
* e-shell.c (struct _EShellPrivate): New member

View File

@ -26,6 +26,8 @@
#include "e-component-registry.h"
#include "e-shell-utils.h"
#include "e-util/e-lang-utils.h"
#include <gal/util/e-util.h>
@ -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);

View File

@ -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);