Support adjustments where the ListBox is not at top

This commit is contained in:
Alexander Larsson 2012-05-21 14:39:57 +02:00
parent e713145454
commit fbf0e16483

View file

@ -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) {