Fixed remaining issues with text bubbles by moving them to top of the hierarchy when focused

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5889 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-09-04 23:40:30 +00:00
parent 13e0f1519f
commit 93d2f49671
2 changed files with 13 additions and 6 deletions

View File

@@ -106,21 +106,26 @@ void BubbleWidget::updateSize()
}
// ----------------------------------------------------------------------------
/*
EventPropagation BubbleWidget::focused(const int playerID)
{
if (m_element != NULL)
{
IGUIStaticText* widget = getIrrlichtElement<IGUIStaticText>();
//widget->setDrawBorder(true);
widget->setRelativePosition(m_expanded_size);
widget->setText(getText().c_str());
// bring element to top (with a hack because irrlicht does not appear to offer a built-in way to do this)
m_element->grab();
IGUIElement* parent = m_parent;
if (parent == NULL) parent = GUIEngine::getGUIEnv()->getRootGUIElement();
parent->removeChild(m_element);
parent->addChild(m_element);
m_element->drop();
}
return EVENT_LET;
}
// ----------------------------------------------------------------------------
/*
void BubbleWidget::unfocused(const int playerID)
{
if (m_element != NULL)

View File

@@ -50,6 +50,8 @@ namespace GUIEngine
virtual void add();
virtual EventPropagation focused(const int playerID);
void updateSize();
};