diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-12-18 13:54:23 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-12-18 15:03:35 (GMT) |
commit | c8e7e728f897cce45e9f94dbf16be6731f92e414 (patch) | |
tree | 46181863153091f0a36c1e640a501f786f61dccb | |
parent | d418a8336d610f9d8d4d1e75d55cadeec24eef7a (diff) | |
download | Qt-c8e7e728f897cce45e9f94dbf16be6731f92e414.zip Qt-c8e7e728f897cce45e9f94dbf16be6731f92e414.tar.gz Qt-c8e7e728f897cce45e9f94dbf16be6731f92e414.tar.bz2 |
Fix a bug in resizing the anomaly browser demo.
The sliding surface does not move, the position of the children
must be used to find the correct layout.
-rw-r--r-- | demos/embedded/anomaly/src/BrowserWindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/demos/embedded/anomaly/src/BrowserWindow.cpp b/demos/embedded/anomaly/src/BrowserWindow.cpp index 1163b6a..30b6b91 100644 --- a/demos/embedded/anomaly/src/BrowserWindow.cpp +++ b/demos/embedded/anomaly/src/BrowserWindow.cpp @@ -150,6 +150,9 @@ void BrowserWindow::keyReleaseEvent(QKeyEvent *event) void BrowserWindow::resizeEvent(QResizeEvent *event) { + const QSize oldSize = event->oldSize(); + const qreal oldSlidingRatio = static_cast<qreal>(qAbs(m_homeView->x())) / oldSize.width(); + const QSize newSize = event->size(); m_slidingSurface->resize(newSize.width() * 2, newSize.height()); @@ -159,7 +162,5 @@ void BrowserWindow::resizeEvent(QResizeEvent *event) m_browserView->resize(newSize); m_browserView->move(newSize.width(), 0); - const QSize oldSize = event->oldSize(); - const qreal oldSlidingRatio = static_cast<qreal>(qAbs(m_slidingSurface->x())) / oldSize.width(); setSlideValue(oldSlidingRatio); } |