aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-06-29 17:47:11 +0800
committerChris Toshok <toshok@src.gnome.org>2001-06-29 17:47:11 +0800
commit8093ffc805f49cc117c3a38cc36643ddc7e2ab1a (patch)
tree5fa602b9c2247361d19cd66051a962b6ba4bf777 /addressbook/gui/widgets/e-minicard.c
parent859c2cb692ebc3a7e851884c6d22c29b5240c918 (diff)
downloadgsoc2013-evolution-8093ffc805f49cc117c3a38cc36643ddc7e2ab1a.tar.gz
gsoc2013-evolution-8093ffc805f49cc117c3a38cc36643ddc7e2ab1a.tar.zst
gsoc2013-evolution-8093ffc805f49cc117c3a38cc36643ddc7e2ab1a.zip
add EVOLUTION_IMAGESDIR define.
2001-06-29 Chris Toshok <toshok@ximian.com> * gui/widgets/Makefile.am (INCLUDES): add EVOLUTION_IMAGESDIR define. * gui/widgets/e-minicard.h (struct _EMinicard): add our pixbuf and pixbuf size. * gui/widgets/e-minicard.c (e_minicard_init): init the icon pixbuf and its size. (e_minicard_destroy): unref the list_icon_pixbuf. (e_minicard_realize): create the list_icon GnomeCanvasPixbuf. (e_minicard_resize_children): clip the header_text by the list_icon, and place the list_icon in the right spot. (remodel): show the list_icon if we're a list, and hide it otherwise. svn path=/trunk/; revision=10596
Diffstat (limited to 'addressbook/gui/widgets/e-minicard.c')
-rw-r--r--addressbook/gui/widgets/e-minicard.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 6c06952c6e..2d74280b72 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -27,6 +27,7 @@
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
+#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include <gal/e-text/e-text.h>
#include <gal/util/e-util.h>
#include <gal/widgets/e-canvas-utils.h>
@@ -64,6 +65,8 @@ struct _EMinicardField {
GnomeCanvasItem *label;
};
+#define LIST_ICON_FILENAME "contact-is-a-list.png"
+
#define E_MINICARD_FIELD(field) ((EMinicardField *)(field))
static void
@@ -187,6 +190,9 @@ e_minicard_init (EMinicard *minicard)
minicard->card = NULL;
minicard->simple = e_card_simple_new(NULL);
+ minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME);
+ minicard->list_icon_size = gdk_pixbuf_get_height (minicard->list_icon_pixbuf);
+
minicard->editor = NULL;
minicard->changed = FALSE;
@@ -331,6 +337,8 @@ e_minicard_destroy (GtkObject *object)
g_list_foreach(e_minicard->fields, (GFunc) e_minicard_field_destroy, NULL);
g_list_free(e_minicard->fields);
+ gdk_pixbuf_unref (e_minicard->list_icon_pixbuf);
+
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -404,8 +412,15 @@ e_minicard_realize (GnomeCanvasItem *item)
"text", "",
"draw_background", FALSE,
NULL );
+
e_canvas_item_move_absolute(e_minicard->header_text, 6, 6);
+ e_minicard->list_icon =
+ gnome_canvas_item_new ( group,
+ gnome_canvas_pixbuf_get_type(),
+ "pixbuf", e_minicard->list_icon_pixbuf,
+ NULL);
+
remodel(e_minicard);
e_canvas_item_request_reflow(item);
@@ -608,9 +623,15 @@ e_minicard_resize_children( EMinicard *e_minicard )
if (e_minicard->header_text) {
gnome_canvas_item_set( e_minicard->header_text,
- "width", (double) e_minicard->width - 12,
+ "width", ((double) e_minicard->width - 12
+ - (e_card_evolution_list (e_minicard->card) ? e_minicard->list_icon_size : 0.0)),
NULL );
}
+ if (e_minicard->list_icon) {
+ e_canvas_item_move_absolute(e_minicard->list_icon,
+ e_minicard->width - e_minicard->list_icon_size - 3,
+ 3);
+ }
for ( list = e_minicard->fields; list; list = g_list_next( list ) ) {
gnome_canvas_item_set( E_MINICARD_FIELD( list->data )->label,
"width", (double) e_minicard->width - 4.0,
@@ -718,6 +739,13 @@ remodel( EMinicard *e_minicard )
g_free(file_as);
}
+ if ( e_card_evolution_list (e_minicard->card) ) {
+ gnome_canvas_item_show (e_minicard->list_icon);
+ }
+ else {
+ gnome_canvas_item_hide (e_minicard->list_icon);
+ }
+
list = e_minicard->fields;
e_minicard->fields = NULL;