diff -r dee5afe5301f -r 3f74d0d4af4c demos/embedded/anomaly/src/BrowserWindow.cpp --- a/demos/embedded/anomaly/src/BrowserWindow.cpp Mon Mar 15 12:43:09 2010 +0200 +++ b/demos/embedded/anomaly/src/BrowserWindow.cpp Thu Apr 08 14:19:33 2010 +0300 @@ -93,12 +93,12 @@ { // we use a ratio to handle resize corectly const int pos = -qRound(slideRatio * width()); - m_slidingSurface->scroll(pos - m_browserView->x(), 0); + m_slidingSurface->scroll(pos - m_homeView->x(), 0); - if (qFuzzyCompare(slideRatio, static_cast(0.0f))) { + if (qFuzzyCompare(slideRatio, static_cast(1.0f))) { m_browserView->show(); m_homeView->hide(); - } else if (qFuzzyCompare(slideRatio, static_cast(1.0f))) { + } else if (qFuzzyCompare(slideRatio, static_cast(0.0f))) { m_homeView->show(); m_browserView->hide(); } else { @@ -110,13 +110,13 @@ qreal BrowserWindow::slideValue() const { Q_ASSERT(m_slidingSurface->x() < width()); - return static_cast(qAbs(m_browserView->x())) / width(); + return static_cast(qAbs(m_homeView->x())) / width(); } void BrowserWindow::showHomeView() { m_animation->setStartValue(slideValue()); - m_animation->setEndValue(1.0f); + m_animation->setEndValue(0.0f); m_animation->start(); m_homeView->setFocus(); } @@ -124,7 +124,7 @@ void BrowserWindow::showBrowserView() { m_animation->setStartValue(slideValue()); - m_animation->setEndValue(0.0f); + m_animation->setEndValue(1.0f); m_animation->start(); m_browserView->setFocus(); @@ -140,7 +140,7 @@ ? QAbstractAnimation::Forward : QAbstractAnimation::Backward; m_animation->setDirection(direction); - } else if (qFuzzyCompare(slideValue(), static_cast(0.0f))) + } else if (qFuzzyCompare(slideValue(), static_cast(1.0f))) showHomeView(); else showBrowserView(); @@ -151,16 +151,16 @@ void BrowserWindow::resizeEvent(QResizeEvent *event) { const QSize oldSize = event->oldSize(); - const qreal oldSlidingRatio = static_cast(qAbs(m_browserView->x())) / oldSize.width(); + const qreal oldSlidingRatio = static_cast(qAbs(m_homeView->x())) / oldSize.width(); const QSize newSize = event->size(); m_slidingSurface->resize(newSize.width() * 2, newSize.height()); m_homeView->resize(newSize); - m_homeView->move(newSize.width(), 0); + m_homeView->move(0, 0); m_browserView->resize(newSize); - m_browserView->move(0, 0); + m_browserView->move(newSize.width(), 0); setSlideValue(oldSlidingRatio); }