Fix bug with deactivated widgets where visibility is changed
This commit is contained in:
@@ -631,7 +631,7 @@ void EventHandler::sendEventToUser(GUIEngine::Widget* widget, std::string& name,
|
||||
|
||||
EventPropagation EventHandler::onWidgetActivated(GUIEngine::Widget* w, const int playerID)
|
||||
{
|
||||
if (w->m_deactivated) return EVENT_BLOCK;
|
||||
if (!w->isActivated()) return EVENT_BLOCK;
|
||||
|
||||
Widget* parent = w->m_event_handler;
|
||||
|
||||
@@ -658,7 +658,7 @@ EventPropagation EventHandler::onWidgetActivated(GUIEngine::Widget* w, const int
|
||||
parent = parent->m_event_handler;
|
||||
}
|
||||
|
||||
if (parent->m_deactivated) return EVENT_BLOCK;
|
||||
if (!parent->isActivated()) return EVENT_BLOCK;
|
||||
|
||||
/* notify the found event event handler, and also notify the main callback if the
|
||||
parent event handler says so */
|
||||
@@ -699,7 +699,7 @@ EventPropagation EventHandler::onGUIEvent(const SEvent& event)
|
||||
{
|
||||
Widget* w = GUIEngine::getWidget(id);
|
||||
if (w == NULL) break;
|
||||
if (w->m_deactivated)
|
||||
if (!w->isActivated())
|
||||
{
|
||||
GUIEngine::getCurrentScreen()->onDisabledItemClicked(w->m_properties[PROP_ID].c_str());
|
||||
return EVENT_BLOCK;
|
||||
|
||||
@@ -339,7 +339,6 @@ void Widget::setVisible(bool visible)
|
||||
m_element->setVisible(visible);
|
||||
}
|
||||
m_is_visible = visible;
|
||||
m_deactivated = !visible;
|
||||
|
||||
const int childrenCount = m_children.size();
|
||||
for (int n=0; n<childrenCount; n++)
|
||||
|
||||
@@ -173,8 +173,6 @@ namespace GUIEngine
|
||||
|
||||
/** Override method from base class Widget */
|
||||
virtual void setDeactivated();
|
||||
|
||||
bool isActivated() { return !m_deactivated; }
|
||||
|
||||
/** Display custom text in spinner */
|
||||
void setCustomText(const core::stringw& text);
|
||||
|
||||
Reference in New Issue
Block a user