summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-04-08 03:06:03 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-04-08 03:06:03 +0000
commitceb0f66e512565e56fe68c2edc7dee39383abe56 (patch)
treeb9c6ed2ad7e4c973aaf4aad44ac33dedae9e75a6
parent3de957405ff0a299450aca5b50522094817e26ad (diff)
downloadgdk-pixbuf-ceb0f66e512565e56fe68c2edc7dee39383abe56.tar.gz
Don't clamp position here prematurely -- we might not have the right
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp position here prematurely -- we might not have the right ->min_position and ->max_position yet.
-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/gtkpaned.c27
8 files changed, 59 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 023a68fbd..c34dd5c1a 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
+Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
+ position here prematurely -- we might not have the
+ right ->min_position and ->max_position yet.
+
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 301eaec0e..7b2d7852c 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -455,9 +455,13 @@ gtk_paned_set_position (GtkPaned *paned,
if (position >= 0)
{
- paned->child1_size = CLAMP (position,
- paned->min_position,
- paned->max_position);
+ /* We don't clamp here - the assumption is that
+ * if the total allocation changes at the same time
+ * as the position, the position set is with reference
+ * to the new total size. If only the position changes,
+ * then clamping will occur in gtk_paned_compute_position()
+ */
+ paned->child1_size = position;
paned->position_set = TRUE;
}
else
@@ -525,13 +529,16 @@ gtk_paned_compute_position (GtkPaned *paned,
}
else
{
- if (paned->last_allocation < 0)
- paned->last_allocation = allocation;
-
- if (paned->child1_resize && !paned->child2_resize)
- paned->child1_size += (allocation - paned->last_allocation);
- else if (!(!paned->child1_resize && paned->child2_resize))
- paned->child1_size = allocation * ((gdouble)paned->child1_size / (paned->last_allocation));
+ /* If the position was set before the initial allocation.
+ * (paned->last_allocation < 0) just clamp it and leave it.
+ */
+ if (paned->last_allocation >= 0)
+ {
+ if (paned->child1_resize && !paned->child2_resize)
+ paned->child1_size += (allocation - paned->last_allocation);
+ else if (!(!paned->child1_resize && paned->child2_resize))
+ paned->child1_size = allocation * ((gdouble)paned->child1_size / (paned->last_allocation));
+ }
}
paned->child1_size = CLAMP (paned->child1_size,