fix walking while the mouse is over topmenu buttons

This commit is contained in:
Eduardo Bart 2011-11-07 22:31:17 -02:00
parent ce67fd1733
commit 61ce6d6331
1 changed files with 7 additions and 3 deletions

View File

@ -351,9 +351,13 @@ void UIWidget::addChild(const UIWidgetPtr& child)
m_children.push_back(child); m_children.push_back(child);
child->setParent(asUIWidget()); child->setParent(asUIWidget());
// always focus new child // focus must be set after the style has been loaded
if(child->isFocusable() && child->isExplicitlyVisible() && child->isExplicitlyEnabled()) auto self = asUIWidget();
focusChild(child, Fw::ActiveFocusReason); g_dispatcher.addEvent([=]() {
// always focus new child
if(child->isFocusable() && child->isExplicitlyVisible() && child->isExplicitlyEnabled())
self->focusChild(child, Fw::ActiveFocusReason);
});
// create default layout // create default layout
if(!m_layout) if(!m_layout)