Navigation Menu

Skip to content

Commit

Permalink
Fix bug with deactivated widgets where visibility is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Flakebi committed Jun 5, 2014
1 parent 48b9016 commit bf76fbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/guiengine/event_handler.cpp
Expand Up @@ -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;

Expand All @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/guiengine/widget.cpp
Expand Up @@ -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++)
Expand Down
2 changes: 0 additions & 2 deletions src/guiengine/widgets/spinner_widget.hpp
Expand Up @@ -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);
Expand Down

0 comments on commit bf76fbf

Please sign in to comment.