From fbf0e164834c9093dc3553a05e5d8ebab6760a5a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 21 May 2012 14:39:57 +0200 Subject: [PATCH] Support adjustments where the ListBox is not at top --- egg-list-box.vala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/egg-list-box.vala b/egg-list-box.vala index c3525b0f..95065973 100644 --- a/egg-list-box.vala +++ b/egg-list-box.vala @@ -343,9 +343,12 @@ public class Egg.ListBox : Container { cursor_child = child; this.grab_focus (); this.queue_draw (); - if (child != null && adjustment != null) - adjustment.clamp_page (cursor_child.y, - cursor_child.y + cursor_child.height); + if (child != null && adjustment != null) { + Allocation allocation; + this.get_allocation (out allocation); + adjustment.clamp_page (cursor_child.y + allocation.y, + cursor_child.y + allocation.y + cursor_child.height); + } } private void update_selected (ChildInfo? child) {