aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-click-to-add.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-30 03:22:24 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-30 03:22:24 +0800
commit3649d5dc6d7279d6c218d241232dea73c5c773d2 (patch)
tree89520e235371866a92f889e885eb30ed09f44b6c /widgets/table/e-table-click-to-add.c
parentf0bcf06559405a3de5271f4aeb3472c8a2b7aeb3 (diff)
downloadgsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.tar
gsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.tar.gz
gsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.tar.bz2
gsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.tar.lz
gsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.tar.xz
gsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.tar.zst
gsoc2013-evolution-3649d5dc6d7279d6c218d241232dea73c5c773d2.zip
From mail:
2000-06-29 Christopher James Lahey <clahey@helixcode.com> * message-list.c, mail-ops.c: Changed the name of e_table_select_row to e_table_set_cursor_row. From widgets/e-table: 2000-06-29 Christopher James Lahey <clahey@helixcode.com> * e-table-click-to-add.c: Made this appear a bit better. * e-table-defines.h: Cleaned this up a bit, added ETableForeachFunc. * e-table-group-container.c, e-table-group-leaf.c, e-table-group.c, e-table-group.h, e-table-item.c, e-table-item.h, e-table.c, e-table.h: Changed e_table_select_row to e_table_set_cursor_row. Changed e_table_get_selected_view_row to e_table_get_cursor_row. Added e_table_selected_row_foreach. * e-table-header-item.c: Fixed some warnings. * e-table-sorted-variable.c: Removed some unneeded debugging print statments. * e-tree-example-1.c: Changed e_table_get_selected_view_row to e_table_get_cursor_row. svn path=/trunk/; revision=3799
Diffstat (limited to 'widgets/table/e-table-click-to-add.c')
-rw-r--r--widgets/table/e-table-click-to-add.c49
1 files changed, 45 insertions, 4 deletions
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
index 30bf96b42a..0be15dfd67 100644
--- a/widgets/table/e-table-click-to-add.c
+++ b/widgets/table/e-table-click-to-add.c
@@ -20,6 +20,7 @@
#include "e-table-one.h"
#include "widgets/e-text/e-text.h"
#include "e-util/e-canvas.h"
+#include "e-util/e-canvas-utils.h"
enum {
ROW_SELECTION,
@@ -172,7 +173,11 @@ etcta_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
NULL);
if (etcta->text)
gnome_canvas_item_set(etcta->text,
- "width", etcta->width,
+ "width", etcta->width - 4,
+ NULL);
+ if (etcta->rect)
+ gnome_canvas_item_set(etcta->rect,
+ "x2", etcta->width - 1,
NULL);
break;
}
@@ -216,7 +221,17 @@ etcta_realize (GnomeCanvasItem *item)
e_text_get_type(),
"text", etcta->message ? etcta->message : "",
"anchor", GTK_ANCHOR_NW,
- "width", etcta->width,
+ "width", etcta->width - 4,
+ NULL);
+ e_canvas_item_move_absolute (etcta->text, 2, 2);
+ etcta->rect = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item),
+ gnome_canvas_rect_get_type(),
+ "x1", (double) 0,
+ "y1", (double) 0,
+ "x2", (double) etcta->width - 1,
+ "y2", (double) etcta->height - 1,
+ "outline_color", "black",
+ "fill_color", NULL,
NULL);
if (GNOME_CANVAS_ITEM_CLASS (etcta_parent_class)->realize)
@@ -253,6 +268,10 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e)
gtk_object_destroy(GTK_OBJECT(etcta->text));
etcta->text = NULL;
}
+ if (etcta->rect) {
+ gtk_object_destroy(GTK_OBJECT(etcta->rect));
+ etcta->rect = NULL;
+ }
if (!etcta->row) {
ETableModel *one;
@@ -295,17 +314,27 @@ etcta_reflow (GnomeCanvasItem *item, int flags)
{
ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item);
+ double old_height = etcta->height;
+
if (etcta->text) {
gtk_object_get(GTK_OBJECT(etcta->text),
"height", &etcta->height,
NULL);
+ etcta->height += 4;
}
if (etcta->row) {
gtk_object_get(GTK_OBJECT(etcta->row),
"height", &etcta->height,
NULL);
}
- e_canvas_item_request_parent_reflow(item);
+
+ if (etcta->rect) {
+ gtk_object_set(GTK_OBJECT(etcta->rect),
+ "y2", etcta->height - 1,
+ NULL);
+ }
+ if (old_height != etcta->height)
+ e_canvas_item_request_parent_reflow(item);
}
static void
@@ -404,7 +433,19 @@ e_table_click_to_add_commit (ETableClickToAdd *etcta)
e_text_get_type(),
"text", etcta->message ? etcta->message : "",
"anchor", GTK_ANCHOR_NW,
- "width", etcta->width,
+ "width", etcta->width - 4,
+ NULL);
+ e_canvas_item_move_absolute (etcta->text, 2, 2);
+ }
+ if (!etcta->rect) {
+ etcta->rect = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta),
+ gnome_canvas_rect_get_type(),
+ "x1", (double) 0,
+ "y1", (double) 0,
+ "x2", (double) etcta->width - 1,
+ "y2", (double) etcta->height - 1,
+ "outline_color", "black",
+ "fill_color", NULL,
NULL);
}
}