summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style_symbian.cpp25
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