summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@nokia.com>2012-08-15 12:50:57 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-23 10:25:55 +0200
commite645bc3ccfb3c4a8186cbe7864657e97f9536348 (patch)
tree84502903d2eb2ef4ce7790ff6cefa33bea5309e9 /src
parentc84ac8de9c6502caaa8cbdc8fbc2de3029a40afc (diff)
uikit: update screen geometry correctly for interface orientation
Broke with baeb42184402454da3e337bbfa2f4d5c7346435f Change-Id: Ia8d844b7b4b9815a1cce4a1acccdbe515149d3ea Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/uikit/quikitscreen.mm13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm
index a35a3cdeb0..86e88c6231 100644
--- a/src/plugins/platforms/uikit/quikitscreen.mm
+++ b/src/plugins/platforms/uikit/quikitscreen.mm
@@ -55,10 +55,7 @@ QUIKitScreen::QUIKitScreen(int screenIndex)
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CGRect bounds = [uiScreen() bounds];
CGFloat scale = [uiScreen() scale];
- m_geometry = QRect(bounds.origin.x * scale,
- bounds.origin.y * scale,
- bounds.size.width * scale,
- bounds.size.height * scale);
+ updateInterfaceOrientation();
m_format = QImage::Format_ARGB32_Premultiplied;
@@ -93,15 +90,17 @@ UIScreen *QUIKitScreen::uiScreen() const
void QUIKitScreen::updateInterfaceOrientation()
{
CGRect bounds = [uiScreen() bounds];
+ CGFloat scale = [uiScreen() scale];
switch ([[UIApplication sharedApplication] statusBarOrientation]) {
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
- m_geometry = QRect(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height);;
+ m_geometry = QRect(bounds.origin.x * scale, bounds.origin.y * scale,
+ bounds.size.width * scale, bounds.size.height * scale);;
break;
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
- m_geometry = QRect(bounds.origin.x, bounds.origin.y,
- bounds.size.height, bounds.size.width);
+ m_geometry = QRect(bounds.origin.x * scale, bounds.origin.y * scale,
+ bounds.size.height * scale, bounds.size.width * scale);
break;
}
foreach (QWidget *widget, qApp->topLevelWidgets()) {