From 455138263156f9446be98ad077863767f806bd2e Mon Sep 17 00:00:00 2001 From: Lars Hamann Date: Mon, 18 Jan 1999 00:36:33 +0000 Subject: [PATCH] fixed auto resize bug. Mon Jan 18 01:21:03 1999 Lars Hamann * gtk/gtkctree.c (draw_row): fixed auto resize bug. --- ChangeLog | 4 ++++ ChangeLog.pre-2-0 | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-2 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkctree.c | 19 ++++++++++++++----- 8 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d900e42cf..46bf692932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 7d900e42cf..46bf692932 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7d900e42cf..46bf692932 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 7d900e42cf..46bf692932 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 7d900e42cf..46bf692932 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7d900e42cf..46bf692932 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7d900e42cf..46bf692932 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Mon Jan 18 01:21:03 1999 Lars Hamann + + * gtk/gtkctree.c (draw_row): fixed auto resize bug. + Sun Jan 17 17:35:28 CST 1999 Shawn T. Amundson * Released GTK+ 1.1.13 diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c index 272418fb10..d4e32a378d 100644 --- a/gtk/gtkctree.c +++ b/gtk/gtkctree.c @@ -1791,8 +1791,7 @@ draw_row (GtkCList *clist, (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap, &pixmap_width, &height); - width = (pixmap_width + - GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing); + width = pixmap_width; if (GTK_CELL_PIXTEXT (clist_row->cell[i])->text) { @@ -1801,6 +1800,10 @@ draw_row (GtkCList *clist, width += string_width; } + if (GTK_CELL_PIXTEXT (clist_row->cell[i])->text && + GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) + width += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; + if (i == ctree->tree_column) width += (ctree->tree_indent * ((GtkCTreeRow *)clist_row)->level); @@ -1920,10 +1923,16 @@ draw_row (GtkCList *clist, if (string_width) { if (clist->column[i].justification == GTK_JUSTIFY_RIGHT) - offset = (old_offset - string_width - - GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing); + { + offset = (old_offset - string_width); + if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) + offset -= GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; + } else - offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; + { + if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) + offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; + } if (style != GTK_WIDGET (clist)->style) row_center_offset = (((clist->row_height - style->font->ascent -