Permalink
Browse files

Use ExpandArea() instead of custom and flawed code to achieve the sam…

…e in MythUIStateType. Potentially fixes a few drawing bugs.

(cherry picked from commit b25ec2e)
  • Loading branch information...
1 parent 4a113b0 commit 61ba0b78c76815cba7819013c67a3609808e8693 @stuartm stuartm committed Jan 31, 2011
Showing with 3 additions and 13 deletions.
  1. +3 −13 mythtv/libs/libmythui/mythuistatetype.cpp
@@ -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;
}
@@ -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;
}
@@ -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();

0 comments on commit 61ba0b7

Please sign in to comment.