summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2001-09-03 08:41:06 +0000
committerJonathan Blandford <jrb@src.gnome.org>2001-09-03 08:41:06 +0000
commit92c0936ffa2e7bab0b53f4c7201efa79710c48c6 (patch)
treea74a65516bcc76c55f23675576c7e77b604f0751
parentb5ea25c500bb8702ca85f9696bb52c17b6325c5b (diff)
downloadgdk-pixbuf-92c0936ffa2e7bab0b53f4c7201efa79710c48c6.tar.gz
patch from vishnu@pobox.com (Joshua N Pritikin) to fix math and an
Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion, #59731
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-2-06
-rw-r--r--ChangeLog.pre-2-106
-rw-r--r--ChangeLog.pre-2-26
-rw-r--r--ChangeLog.pre-2-46
-rw-r--r--ChangeLog.pre-2-66
-rw-r--r--ChangeLog.pre-2-86
-rw-r--r--gtk/gtktreeview.c19
8 files changed, 52 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 534b95f0e..e087da585 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 534b95f0e..e087da585 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 534b95f0e..e087da585 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 534b95f0e..e087da585 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 534b95f0e..e087da585 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 534b95f0e..e087da585 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 534b95f0e..e087da585 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
+Sun Sep 2 20:32:36 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_scroll_to_cell): patch from
+ vishnu@pobox.com (Joshua N Pritikin) to fix math and an assertion,
+ #59731
+
Sun Sep 2 17:38:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_deleted): Patch from
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 5871fd319..81ed3aa89 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -7034,6 +7034,7 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
GdkRectangle cell_rect;
GdkRectangle vis_rect;
gint dest_x, dest_y;
+ gfloat within_margin = 0;
/* FIXME work on unmapped/unrealized trees? maybe implement when
* we do incremental reflow for trees
@@ -7074,10 +7075,10 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
}
else
{
- if (dest_x < vis_rect.x)
- dest_x = vis_rect.x;
- else if (dest_x + cell_rect.width > vis_rect.x + vis_rect.width)
- dest_x = vis_rect.x + vis_rect.width - cell_rect.width;
+ if (cell_rect.x < vis_rect.x)
+ dest_x = cell_rect.x - vis_rect.width * within_margin;
+ else if (cell_rect.x + cell_rect.width > vis_rect.x + vis_rect.width)
+ dest_x = cell_rect.x + cell_rect.width - vis_rect.width * (1 - within_margin);
}
}
@@ -7089,10 +7090,10 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
}
else
{
- if (dest_y < vis_rect.y)
- dest_y = vis_rect.y;
- else if (dest_y + cell_rect.height > vis_rect.y + vis_rect.height)
- dest_y = vis_rect.y + vis_rect.height - cell_rect.height;
+ if (cell_rect.y < vis_rect.y)
+ dest_y = cell_rect.y - vis_rect.height * within_margin;
+ else if (cell_rect.y + cell_rect.height > vis_rect.y + vis_rect.height)
+ dest_y = cell_rect.y + cell_rect.height - vis_rect.height * (1 - within_margin);
}
}
@@ -7929,7 +7930,7 @@ gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
g_return_if_fail (column == NULL || GTK_IS_TREE_VIEW_COLUMN (column));
g_return_if_fail (rect != NULL);
- g_return_if_fail (column->tree_view == (GtkWidget *) tree_view);
+ g_return_if_fail (!column || column->tree_view == (GtkWidget *) tree_view);
g_return_if_fail (GTK_WIDGET_REALIZED (tree_view));
gtk_widget_style_get (GTK_WIDGET (tree_view), "vertical_separator", &vertical_separator, NULL);