summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2011-04-15 14:27:18 (GMT)
committercon <qtc-committer@nokia.com>2011-04-15 14:28:08 (GMT)
commit6849e252cb8ebadc3211485fd059265635f3aba0 (patch)
tree115f28efb431bd3299112916e9c307d8d3fb6fc3
parent42998c318800ed5ac578e54a13063d40b94ebf66 (diff)
downloadQt-6849e252cb8ebadc3211485fd059265635f3aba0.zip
Qt-6849e252cb8ebadc3211485fd059265635f3aba0.tar.gz
Qt-6849e252cb8ebadc3211485fd059265635f3aba0.tar.bz2
Adapt to different uikit resolutions.
-rw-r--r--src/plugins/platforms/uikit/quikitscreen.mm20
-rw-r--r--src/plugins/platforms/uikit/quikitwindow.mm2
2 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm
index 97382e3..21494c9 100644
--- a/src/plugins/platforms/uikit/quikitscreen.mm
+++ b/src/plugins/platforms/uikit/quikitscreen.mm
@@ -53,24 +53,22 @@ QUIKitScreen::QUIKitScreen(int screenIndex)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
UIScreen *screen = [[UIScreen screens] objectAtIndex:screenIndex];
- UIScreenMode *mode = [screen currentMode];
- CGSize size = [mode size];
- m_geometry = QRect(0, 0, size.width, size.height);
- CGRect bounds = [screen bounds]; // in 'points', 1p == 1/160in
-
-// qreal xDpi = size.width * 160. / bounds.size.width;
-// qreal yDpi = size.height * 160. / bounds.size.height;
-// qDebug() << xDpi << yDpi;
+ CGRect bounds = [screen bounds];
+ m_geometry = QRect(0, 0, bounds.size.width, bounds.size.height);
m_format = QImage::Format_ARGB32;
m_depth = 24;
const qreal inch = 25.4;
- const qreal dpi = 160.;
+ qreal dpi = 160.;
+ int dragDistance = 14;
+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
+ dpi = 132.;
+ dragDistance = 10;
+ }
m_physicalSize = QSize(qRound(bounds.size.width * inch / dpi), qRound(bounds.size.height * inch / dpi));
- if (m_index == 0)
- qApp->setStartDragDistance(12);
+ qApp->setStartDragDistance(dragDistance);
[pool release];
}
diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm
index cda5d4c..52d1846 100644
--- a/src/plugins/platforms/uikit/quikitwindow.mm
+++ b/src/plugins/platforms/uikit/quikitwindow.mm
@@ -127,7 +127,7 @@ private:
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
eaglLayer.opaque = TRUE;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking,
+ [NSNumber numberWithBool:YES], kEAGLDrawablePropertyRetainedBacking,
kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
nil];
autocapitalizationType = UITextAutocapitalizationTypeNone;