summaryrefslogtreecommitdiff
path: root/demos/embedded
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-12-18 14:54:23 +0100
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-12-18 16:03:35 +0100
commitc8e7e728f897cce45e9f94dbf16be6731f92e414 (patch)
tree46181863153091f0a36c1e640a501f786f61dccb /demos/embedded
parentd418a8336d610f9d8d4d1e75d55cadeec24eef7a (diff)
downloadqt4-tools-c8e7e728f897cce45e9f94dbf16be6731f92e414.tar.gz
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.
Diffstat (limited to 'demos/embedded')
-rw-r--r--demos/embedded/anomaly/src/BrowserWindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/demos/embedded/anomaly/src/BrowserWindow.cpp b/demos/embedded/anomaly/src/BrowserWindow.cpp
index 1163b6a1a7..30b6b914b0 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);
}