diff options
author | Benjamin Otte <otte@redhat.com> | 2012-04-27 03:33:57 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-04-27 03:33:57 +0200 |
commit | 0cf3791c280b34de771db324a650109266bda4f0 (patch) | |
tree | 4776d5a78c45cd5a861ce8c0aab4d10c7ff38855 /gtk/gtktoolpalette.c | |
parent | 145b59b4b1f096a361dfbf626b8c5a2876b159a5 (diff) | |
download | gtk+-0cf3791c280b34de771db324a650109266bda4f0.tar.gz |
toolpalette: Configure adjustment properly
https://bugzilla.gnome.org/show_bug.cgi?id=673650
Diffstat (limited to 'gtk/gtktoolpalette.c')
-rw-r--r-- | gtk/gtktoolpalette.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index 0dd9b21be6..0655bffeb0 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, |