aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-10-23 08:20:01 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-10-23 08:20:01 +0800
commit0935ca72c9f6d2d0a8df816cc8973abc660e9630 (patch)
tree8b09ee92238abb6a6e427bf706602d0a54eed3b8
parentabb1418197b7a28a83a005da765aa62e3c2aaa1c (diff)
downloadgsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.tar
gsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.tar.gz
gsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.tar.bz2
gsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.tar.lz
gsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.tar.xz
gsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.tar.zst
gsoc2013-evolution-0935ca72c9f6d2d0a8df816cc8973abc660e9630.zip
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
-rw-r--r--shell/ChangeLog8
-rw-r--r--shell/e-component-registry.c34
-rw-r--r--shell/e-sidebar.c1
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,5 +1,13 @@
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
"component_registry".
(e_shell_construct): Don't call e_shell_unregister_all().
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 <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);
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);