summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2002-10-17 20:09:39 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2002-10-17 20:09:39 +0000
commita9d26e1478f33ca3d1aec25e7378feb7fc340022 (patch)
tree1b08a3b6ce4edb7605346eaa91cb77b15806dec5 /gtk
parent79193611f4057d4af16bc6855bd582876d76fbcd (diff)
downloadgdk-pixbuf-a9d26e1478f33ca3d1aec25e7378feb7fc340022.tar.gz
Take arrows into account when clamping the offset. Fixes #95758.
Thu Oct 17 22:09:05 2002 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkmenu.c (gtk_menu_scroll_to): Take arrows into account when clamping the offset. Fixes #95758.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkmenu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 321c4ddca..f9f8d152c 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -2538,12 +2538,6 @@ gtk_menu_scroll_to (GtkMenu *menu,
view_height -= (border_width + widget->style->ythickness) * 2;
menu_height = widget->requisition.height - (border_width + widget->style->ythickness) * 2;
- offset = CLAMP (offset, 0, menu_height - view_height);
-
- /* Scroll the menu: */
- if (GTK_WIDGET_REALIZED (menu))
- gdk_window_move (menu->bin_window, 0, -offset);
-
x = border_width + widget->style->xthickness;
y = border_width + widget->style->ythickness;
@@ -2585,6 +2579,12 @@ gtk_menu_scroll_to (GtkMenu *menu,
y += MENU_SCROLL_ARROW_HEIGHT;
}
+ offset = CLAMP (offset, 0, menu_height - view_height);
+
+ /* Scroll the menu: */
+ if (GTK_WIDGET_REALIZED (menu))
+ gdk_window_move (menu->bin_window, 0, -offset);
+
if (GTK_WIDGET_REALIZED (menu))
gdk_window_move_resize (menu->view_window,
x,