summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Morgan <smorgan@mythtv.org>2011-01-31 13:47:07 (GMT)
committer Stuart Morgan <smorgan@mythtv.org>2011-01-31 13:49:12 (GMT)
commit61ba0b78c76815cba7819013c67a3609808e8693 (patch)
tree0d68f32d40b702e894af3ffd14b555694b984024
parent4a113b09730f69d954bcad7a0c58d6a7aaed4d10 (diff)
Use ExpandArea() instead of custom and flawed code to achieve the same in MythUIStateType. Potentially fixes a few drawing bugs.
(cherry picked from commit b25ec2ebee9bfebf7d148b03c70c6912635d91e4)
-rw-r--r--mythtv/libs/libmythui/mythuistatetype.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/mythtv/libs/libmythui/mythuistatetype.cpp b/mythtv/libs/libmythui/mythuistatetype.cpp
index f8ba6a6..02961e2 100644
--- a/mythtv/libs/libmythui/mythuistatetype.cpp
+++ b/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();