+ root_x += p->get_geometry().x;
+ root_y += p->get_geometry().y;
+ if(Root *root = dynamic_cast<Root *>(p))
+ {
+ const Geometry &rgeom = root->get_geometry();
+ if(lgeom.h*2>rgeom.h)
+ {
+ lgeom.h = rgeom.h/2;
+ lgeom.y = -lgeom.h;
+ }
+ if(root_y+lgeom.y<0)
+ lgeom.y = -root_y;
+ if(root_y+lgeom.y+lgeom.h>rgeom.h)
+ lgeom.y = rgeom.h-lgeom.h-root_y;
+ if(root_x+lgeom.x+lgeom.w>rgeom.w)
+ lgeom.x = rgeom.w-lgeom.w-root_x;
+ break;
+ }
+ }
+ list.set_geometry(lgeom);
+}
+
+void Dropdown::list_item_selected(size_t index)
+{
+ if(dropped)
+ {
+ dropped = false;
+ clear_state(ACTIVE);
+ signal_ungrab_pointer.emit();