-void Panel::button_release(int x, int y, unsigned btn)
-{
- if(pointer_grabbed)
- {
- const Geometry &cgeom = pointer_focus->get_geometry();
- pointer_focus->button_release(x-cgeom.x, y-cgeom.y, btn);
+ Widget *sibling = find_next_child(origin_x, origin_y, origin_dim, nav_x, nav_y);
+ if(!sibling && input_focus)
+ {
+ const Geometry &fgeom = input_focus->get_geometry();
+ origin_x -= fgeom.w*(nav_x*0.5);
+ origin_y -= fgeom.h*(nav_y*0.5);
+ sibling = find_next_child(origin_x, origin_y, origin_dim, nav_x, nav_y);
+ }
+
+ if(sibling)
+ {
+ set_input_focus(sibling);
+ if(Panel *panel = dynamic_cast<Panel *>(sibling))
+ panel->navigate(nav);
+ return true;
+ }