[gtk+/gtk-3-4] toolpalette: Configure adjustment properly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-4] toolpalette: Configure adjustment properly
- Date: Fri, 27 Apr 2012 01:40:25 +0000 (UTC)
commit 67e2e41907add988746f59857ef86d6ea37b8392
Author: Benjamin Otte <otte redhat com>
Date: Fri Apr 27 03:33:57 2012 +0200
toolpalette: Configure adjustment properly
https://bugzilla.gnome.org/show_bug.cgi?id=673650
gtk/gtktoolpalette.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 0dd9b21..0655bff 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -665,30 +665,27 @@ gtk_tool_palette_size_allocate (GtkWidget *widget,
/* update the scrollbar to match the displayed adjustment */
if (adjustment)
{
- gdouble value, lower, upper;
+ gdouble lower, upper;
+
+ total_size = MAX (0, total_size);
+ page_size = MIN (total_size, page_size);
if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation ||
GTK_TEXT_DIR_LTR == direction)
{
lower = 0;
- upper = MAX (0, total_size);
-
- value = MIN (offset, upper - page_size);
- gtk_adjustment_clamp_page (adjustment, value, offset + page_size);
+ upper = total_size;
}
else
{
- lower = page_size - MAX (0, total_size);
+ lower = page_size - total_size;
upper = page_size;
offset = -offset;
-
- value = MAX (offset, lower);
- gtk_adjustment_clamp_page (adjustment, offset, value + page_size);
}
gtk_adjustment_configure (adjustment,
- value,
+ offset,
lower,
upper,
page_size * 0.1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]