diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-05-25 10:56:50 (GMT) |
---|---|---|
committer | Sami Merilä <sami.merila@nokia.com> | 2009-05-25 10:56:50 (GMT) |
commit | 4fed80ce97654adec3baf73d26c21b0967937e83 (patch) | |
tree | 887767bce803d107a41f6f80320fd07d020b1561 /src/gui | |
parent | 2e3826fef5abfece022fbd1f0a1f4fbaf8c5a719 (diff) | |
download | Qt-4fed80ce97654adec3baf73d26c21b0967937e83.zip Qt-4fed80ce97654adec3baf73d26c21b0967937e83.tar.gz Qt-4fed80ce97654adec3baf73d26c21b0967937e83.tar.bz2 |
S60Style: Try to guesstime resolution, if no exact match is found.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qs60style_symbian.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index d29e678..48b759a 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -962,9 +962,8 @@ QFont QS60StylePrivate::s60Font_specific( #ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED void QS60StylePrivate::setActiveLayout() { - //todo: how to find layouts that are of same size (QVGA1 vs. QVGA2) const QSize activeScreenSize(screenSize()); - int activeLayoutIndex = 0; + int activeLayoutIndex = -1; const bool mirrored = !QApplication::isLeftToRight(); const short screenHeight = (short)activeScreenSize.height(); const short screenWidth = (short)activeScreenSize.width(); @@ -976,6 +975,28 @@ void QS60StylePrivate::setActiveLayout() break; } } + + //not found, lets try without mirroring info + if (activeLayoutIndex==-1){ + for (int i=0; i<m_numberOfLayouts; i++) { + if (screenHeight==m_layoutHeaders[i].height && + screenWidth==m_layoutHeaders[i].width) { + activeLayoutIndex = i; + break; + } + } + } + + //not found, lets try with either of dimensions + if (activeLayoutIndex==-1){ + const QSysInfo::S60Version currentRelease = QSysInfo::s60Version(); + const bool landscape = screenHeight < screenWidth; + + activeLayoutIndex = (currentRelease == QSysInfo::SV_S60_3_1 || currentRelease == QSysInfo::SV_S60_3_2) ? 0 : 4; + activeLayoutIndex += (!landscape) ? 2 : 0; + activeLayoutIndex += (!mirrored) ? 1 : 0; + } + m_pmPointer = data[activeLayoutIndex]; } #endif // QT_S60STYLE_LAYOUTDATA_SIMULATED |