diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/minicard/e-minicard-label.c | 11 | ||||
-rw-r--r-- | addressbook/gui/minicard/e-minicard-label.h | 20 | ||||
-rw-r--r-- | addressbook/gui/minicard/e-minicard.c | 17 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-label.c | 11 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-label.h | 20 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 17 |
6 files changed, 42 insertions, 54 deletions
diff --git a/addressbook/gui/minicard/e-minicard-label.c b/addressbook/gui/minicard/e-minicard-label.c index 5b528d6190..3f6a80a890 100644 --- a/addressbook/gui/minicard/e-minicard-label.c +++ b/addressbook/gui/minicard/e-minicard-label.c @@ -25,6 +25,7 @@ #include "e-text.h" #include "e-canvas.h" #include "e-util.h" +#include "e-canvas-utils.h" static void e_minicard_label_init (EMinicardLabel *card); static void e_minicard_label_class_init (EMinicardLabelClass *klass); static void e_minicard_label_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -238,8 +239,6 @@ e_minicard_label_realize (GnomeCanvasItem *item) e_minicard_label->fieldname = gnome_canvas_item_new( group, e_text_get_type(), - "x", (double) 2, - "y", (double) 1, "anchor", GTK_ANCHOR_NW, "clip_width", (double) ( e_minicard_label->width / 2 - 4 ), "clip_height", (double) 1, @@ -248,6 +247,7 @@ e_minicard_label_realize (GnomeCanvasItem *item) "font_gdk", font, "fill_color", "black", NULL ); + e_canvas_item_move_absolute(e_minicard_label->fieldname, 2, 1); if ( e_minicard_label->fieldname_text ) { gnome_canvas_item_set( e_minicard_label->fieldname, @@ -263,8 +263,6 @@ e_minicard_label_realize (GnomeCanvasItem *item) e_minicard_label->field = gnome_canvas_item_new( group, e_text_get_type(), - "x", (double) ( e_minicard_label->width / 2 + 2 ), - "y", (double) 1, "anchor", GTK_ANCHOR_NW, "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ), "clip_height", (double) 1, @@ -274,6 +272,7 @@ e_minicard_label_realize (GnomeCanvasItem *item) "fill_color", "black", "editable", TRUE, NULL ); + e_canvas_item_move_absolute(e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1); if ( e_minicard_label->field_text ) { gnome_canvas_item_set( e_minicard_label->field, @@ -443,9 +442,9 @@ update_label( EMinicardLabel *e_minicard_label ) "clip_width", (double) ( e_minicard_label->width / 2 - 4 ), NULL ); gnome_canvas_item_set( e_minicard_label->field, - "x", (double) ( e_minicard_label->width / 2 + 2 ), "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ), NULL ); + e_canvas_item_move_absolute(e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1); if (old_height != e_minicard_label->height) gtk_signal_emit_by_name (GTK_OBJECT (e_minicard_label), "resize"); @@ -454,9 +453,9 @@ update_label( EMinicardLabel *e_minicard_label ) } - static void resize( GtkObject *object, gpointer data ) { update_label(E_MINICARD_LABEL(data)); } + diff --git a/addressbook/gui/minicard/e-minicard-label.h b/addressbook/gui/minicard/e-minicard-label.h index ddbe7ab191..3311e3c9af 100644 --- a/addressbook/gui/minicard/e-minicard-label.h +++ b/addressbook/gui/minicard/e-minicard-label.h @@ -52,16 +52,16 @@ typedef struct _EMinicardLabelClass EMinicardLabelClass; struct _EMinicardLabel { - GnomeCanvasGroup parent; - - /* item specific fields */ - double width; - double height; - GnomeCanvasItem *fieldname; - GnomeCanvasItem *field; - GnomeCanvasItem *rect; - char *fieldname_text; - char *field_text; + GnomeCanvasGroup parent; + + /* item specific fields */ + double width; + double height; + GnomeCanvasItem *fieldname; + GnomeCanvasItem *field; + GnomeCanvasItem *rect; + char *fieldname_text; + char *field_text; gboolean has_focus; }; diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c index 805c4e78ff..b8d25f5dc6 100644 --- a/addressbook/gui/minicard/e-minicard.c +++ b/addressbook/gui/minicard/e-minicard.c @@ -26,6 +26,7 @@ #include "e-text.h" #include "e-canvas.h" #include "e-util.h" +#include "e-canvas-utils.h" static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *klass); static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -235,8 +236,6 @@ e_minicard_realize (GnomeCanvasItem *item) e_minicard->header_text = gnome_canvas_item_new( group, e_text_get_type(), - "x", (double) 6, - "y", (double) 6, "anchor", GTK_ANCHOR_NW, "clip_width", (double) ( e_minicard->width - 12 ), "clip", TRUE, @@ -245,6 +244,7 @@ e_minicard_realize (GnomeCanvasItem *item) "fill_color", "black", "text", "Chris Lahey", NULL ); + e_canvas_item_move_absolute(e_minicard->header_text, 6, 6); gtk_signal_connect(GTK_OBJECT(e_minicard->header_text), "resize", @@ -253,13 +253,12 @@ e_minicard_realize (GnomeCanvasItem *item) if ( rand() % 2 ) { new_item = gnome_canvas_item_new( group, e_minicard_label_get_type(), - "x", (double) 2, - "y", e_minicard->height, "width", e_minicard->width - 4, "fieldname", "Full Name:", "field", "Christopher James Lahey", NULL ); e_minicard->fields = g_list_append( e_minicard->fields, new_item); + e_canvas_item_move_absolute(new_item, 2, e_minicard->height); gtk_signal_connect(GTK_OBJECT(new_item), "resize", @@ -270,13 +269,12 @@ e_minicard_realize (GnomeCanvasItem *item) if (rand() % 2) { new_item = gnome_canvas_item_new( group, e_minicard_label_get_type(), - "x", (double) 2, - "y", e_minicard->height, "width", e_minicard->width - 4, "fieldname", "Address:", "field", "100 Main St\nHome town, USA", NULL ); e_minicard->fields = g_list_append( e_minicard->fields, new_item); + e_canvas_item_move_absolute(new_item, 2, e_minicard->height); gtk_signal_connect(GTK_OBJECT(new_item), "resize", @@ -287,13 +285,12 @@ e_minicard_realize (GnomeCanvasItem *item) if (rand() % 2) { new_item = gnome_canvas_item_new( group, e_minicard_label_get_type(), - "x", (double) 2, - "y", e_minicard->height, "width", e_minicard->width - 4.0, "fieldname", "Email:", "field", "clahey@address.com", NULL ); e_minicard->fields = g_list_append( e_minicard->fields, new_item); + e_canvas_item_move_absolute(new_item, 2, e_minicard->height); gtk_signal_connect(GTK_OBJECT(new_item), "resize", @@ -432,9 +429,7 @@ _update_card( EMinicard *e_minicard ) gtk_object_get (GTK_OBJECT(list->data), "height", &text_height, NULL); - gnome_canvas_item_set(GNOME_CANVAS_ITEM(list->data), - "y", (double) e_minicard->height, - NULL); + e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(list->data), 2, e_minicard->height); e_minicard->height += text_height; } e_minicard->height += 2; diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index 5b528d6190..3f6a80a890 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -25,6 +25,7 @@ #include "e-text.h" #include "e-canvas.h" #include "e-util.h" +#include "e-canvas-utils.h" static void e_minicard_label_init (EMinicardLabel *card); static void e_minicard_label_class_init (EMinicardLabelClass *klass); static void e_minicard_label_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -238,8 +239,6 @@ e_minicard_label_realize (GnomeCanvasItem *item) e_minicard_label->fieldname = gnome_canvas_item_new( group, e_text_get_type(), - "x", (double) 2, - "y", (double) 1, "anchor", GTK_ANCHOR_NW, "clip_width", (double) ( e_minicard_label->width / 2 - 4 ), "clip_height", (double) 1, @@ -248,6 +247,7 @@ e_minicard_label_realize (GnomeCanvasItem *item) "font_gdk", font, "fill_color", "black", NULL ); + e_canvas_item_move_absolute(e_minicard_label->fieldname, 2, 1); if ( e_minicard_label->fieldname_text ) { gnome_canvas_item_set( e_minicard_label->fieldname, @@ -263,8 +263,6 @@ e_minicard_label_realize (GnomeCanvasItem *item) e_minicard_label->field = gnome_canvas_item_new( group, e_text_get_type(), - "x", (double) ( e_minicard_label->width / 2 + 2 ), - "y", (double) 1, "anchor", GTK_ANCHOR_NW, "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ), "clip_height", (double) 1, @@ -274,6 +272,7 @@ e_minicard_label_realize (GnomeCanvasItem *item) "fill_color", "black", "editable", TRUE, NULL ); + e_canvas_item_move_absolute(e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1); if ( e_minicard_label->field_text ) { gnome_canvas_item_set( e_minicard_label->field, @@ -443,9 +442,9 @@ update_label( EMinicardLabel *e_minicard_label ) "clip_width", (double) ( e_minicard_label->width / 2 - 4 ), NULL ); gnome_canvas_item_set( e_minicard_label->field, - "x", (double) ( e_minicard_label->width / 2 + 2 ), "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ), NULL ); + e_canvas_item_move_absolute(e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1); if (old_height != e_minicard_label->height) gtk_signal_emit_by_name (GTK_OBJECT (e_minicard_label), "resize"); @@ -454,9 +453,9 @@ update_label( EMinicardLabel *e_minicard_label ) } - static void resize( GtkObject *object, gpointer data ) { update_label(E_MINICARD_LABEL(data)); } + diff --git a/addressbook/gui/widgets/e-minicard-label.h b/addressbook/gui/widgets/e-minicard-label.h index ddbe7ab191..3311e3c9af 100644 --- a/addressbook/gui/widgets/e-minicard-label.h +++ b/addressbook/gui/widgets/e-minicard-label.h @@ -52,16 +52,16 @@ typedef struct _EMinicardLabelClass EMinicardLabelClass; struct _EMinicardLabel { - GnomeCanvasGroup parent; - - /* item specific fields */ - double width; - double height; - GnomeCanvasItem *fieldname; - GnomeCanvasItem *field; - GnomeCanvasItem *rect; - char *fieldname_text; - char *field_text; + GnomeCanvasGroup parent; + + /* item specific fields */ + double width; + double height; + GnomeCanvasItem *fieldname; + GnomeCanvasItem *field; + GnomeCanvasItem *rect; + char *fieldname_text; + char *field_text; gboolean has_focus; }; diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 805c4e78ff..b8d25f5dc6 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -26,6 +26,7 @@ #include "e-text.h" #include "e-canvas.h" #include "e-util.h" +#include "e-canvas-utils.h" static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *klass); static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -235,8 +236,6 @@ e_minicard_realize (GnomeCanvasItem *item) e_minicard->header_text = gnome_canvas_item_new( group, e_text_get_type(), - "x", (double) 6, - "y", (double) 6, "anchor", GTK_ANCHOR_NW, "clip_width", (double) ( e_minicard->width - 12 ), "clip", TRUE, @@ -245,6 +244,7 @@ e_minicard_realize (GnomeCanvasItem *item) "fill_color", "black", "text", "Chris Lahey", NULL ); + e_canvas_item_move_absolute(e_minicard->header_text, 6, 6); gtk_signal_connect(GTK_OBJECT(e_minicard->header_text), "resize", @@ -253,13 +253,12 @@ e_minicard_realize (GnomeCanvasItem *item) if ( rand() % 2 ) { new_item = gnome_canvas_item_new( group, e_minicard_label_get_type(), - "x", (double) 2, - "y", e_minicard->height, "width", e_minicard->width - 4, "fieldname", "Full Name:", "field", "Christopher James Lahey", NULL ); e_minicard->fields = g_list_append( e_minicard->fields, new_item); + e_canvas_item_move_absolute(new_item, 2, e_minicard->height); gtk_signal_connect(GTK_OBJECT(new_item), "resize", @@ -270,13 +269,12 @@ e_minicard_realize (GnomeCanvasItem *item) if (rand() % 2) { new_item = gnome_canvas_item_new( group, e_minicard_label_get_type(), - "x", (double) 2, - "y", e_minicard->height, "width", e_minicard->width - 4, "fieldname", "Address:", "field", "100 Main St\nHome town, USA", NULL ); e_minicard->fields = g_list_append( e_minicard->fields, new_item); + e_canvas_item_move_absolute(new_item, 2, e_minicard->height); gtk_signal_connect(GTK_OBJECT(new_item), "resize", @@ -287,13 +285,12 @@ e_minicard_realize (GnomeCanvasItem *item) if (rand() % 2) { new_item = gnome_canvas_item_new( group, e_minicard_label_get_type(), - "x", (double) 2, - "y", e_minicard->height, "width", e_minicard->width - 4.0, "fieldname", "Email:", "field", "clahey@address.com", NULL ); e_minicard->fields = g_list_append( e_minicard->fields, new_item); + e_canvas_item_move_absolute(new_item, 2, e_minicard->height); gtk_signal_connect(GTK_OBJECT(new_item), "resize", @@ -432,9 +429,7 @@ _update_card( EMinicard *e_minicard ) gtk_object_get (GTK_OBJECT(list->data), "height", &text_height, NULL); - gnome_canvas_item_set(GNOME_CANVAS_ITEM(list->data), - "y", (double) e_minicard->height, - NULL); + e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(list->data), 2, e_minicard->height); e_minicard->height += text_height; } e_minicard->height += 2; |