diff options
author | Dominik Kapusta <dominik.kapusta@teleca.com> | 2010-03-05 13:18:39 +0100 |
---|---|---|
committer | Dominik Kapusta <dominik.kapusta@teleca.com> | 2010-03-05 13:26:03 +0100 |
commit | 3b265d8b90c826acb442d4716d84d4ec7fa648f4 (patch) | |
tree | c17810c8af95cb3e279813a9a1ea8cccfa78466b | |
parent | 923d5fd14cfea1d4b2133ecc8f2959f122d576bf (diff) |
Changes: DuiSceneManager::orientation{,Angle}() improvements
RevBy: TrustMe
Details: Return values based on DuiSceneManagerPrivate::angle,
instead of DuiSceneManagerPrivate::newAngle. This makes difference
when it comes to querying current orientation (angle) at the very
beginning of the rotation animation. Currently the new angle was
returned, and this patch fixes it to return the old angle from before
the rotation animation. This provides correct orientation info to
DuiStyleSheet (especially when style() is requested in paint(),
drawBackground(), etc.) and in the end improves orientation animation
look and feel.
-rw-r--r-- | src/scene/duiscenemanager.cpp | 4 | ||||
-rw-r--r-- | tests/ut_duiscenemanager/ut_duiscenemanager.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/scene/duiscenemanager.cpp b/src/scene/duiscenemanager.cpp index d469d54c..070c89fb 100644 --- a/src/scene/duiscenemanager.cpp +++ b/src/scene/duiscenemanager.cpp @@ -1153,14 +1153,14 @@ Dui::Orientation DuiSceneManager::orientation() const { Q_D(const DuiSceneManager); - return d->orientation(d->newAngle); + return d->orientation(d->angle); } Dui::OrientationAngle DuiSceneManager::orientationAngle() const { Q_D(const DuiSceneManager); - return d->newAngle; + return d->angle; } QSize DuiSceneManager::visibleSceneSize(Dui::Orientation orientation) const diff --git a/tests/ut_duiscenemanager/ut_duiscenemanager.cpp b/tests/ut_duiscenemanager/ut_duiscenemanager.cpp index 7f08e5c3..6e397a5a 100644 --- a/tests/ut_duiscenemanager/ut_duiscenemanager.cpp +++ b/tests/ut_duiscenemanager/ut_duiscenemanager.cpp @@ -319,7 +319,7 @@ void Ut_DuiSceneManager::testSceneSizes() QVERIFY(vSR.width() > 0); QVERIFY(vSR.height() > 0); - sm->setOrientationAngle(Dui::Angle90); + sm->setOrientationAngle(Dui::Angle90, Dui::ImmediateOrientationChange); // check scenerects are in correct orientation // what about square? @@ -332,7 +332,7 @@ void Ut_DuiSceneManager::testSceneSizes() vSR = sm->visibleSceneSize(Dui::Landscape); QVERIFY(vSR.width() > vSR.height()); - sm->setOrientationAngle(Dui::Angle180); + sm->setOrientationAngle(Dui::Angle180, Dui::ImmediateOrientationChange); QCOMPARE(sm->orientation(), Dui::Landscape); QCOMPARE(sm->visibleSceneSize(), sm->visibleSceneSize(Dui::Landscape)); |