Skip to content

Commit

Permalink
Use ExpandArea() instead of custom and flawed code to achieve the sam…
Browse files Browse the repository at this point in the history
…e in MythUIStateType. Potentially fixes a few drawing bugs.
  • Loading branch information
stuartm committed Jan 31, 2011
1 parent 746ec9e commit b25ec2e
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions mythtv/libs/libmythui/mythuistatetype.cpp
Expand Up @@ -51,12 +51,7 @@ bool MythUIStateType::AddObject(const QString &name, MythUIType *object)
else
objectArea.CalculateArea(GetMythMainWindow()->GetUIScreenRect());

if (objectArea.width() > m_Area.width() ||
objectArea.height() > m_Area.height())
{
m_Area.setWidth(objectArea.getWidth());
m_Area.setHeight(objectArea.getHeight());
}
ExpandArea(objectArea);

return true;
}
Expand Down Expand Up @@ -88,12 +83,7 @@ bool MythUIStateType::AddObject(StateType type, MythUIType *object)
else
objectArea.CalculateArea(GetMythMainWindow()->GetUIScreenRect());

if (objectArea.width() > m_Area.width() ||
objectArea.height() > m_Area.height())
{
m_Area.setWidth(objectArea.getWidth());
m_Area.setHeight(objectArea.getHeight());
}
ExpandArea(objectArea);

return true;
}
Expand All @@ -104,7 +94,7 @@ bool MythUIStateType::DisplayState(const QString &name)
return false;

MythUIType *old = m_CurrentState;

QMap<QString, MythUIType *>::Iterator i = m_ObjectsByName.find(name.toLower());
if (i != m_ObjectsByName.end())
m_CurrentState = i.value();
Expand Down

0 comments on commit b25ec2e

Please sign in to comment.