summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager_s60.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-05-13 12:29:53 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-05-13 12:29:53 (GMT)
commitdabc653c47c3fcdbbe9e59b8e55306bc0a4d8006 (patch)
tree22438390d9c749da8d8bbcb796ad5282cb820ab3 /src/gui/kernel/qsoftkeymanager_s60.cpp
parent708fcbe457304ac8035c20302e6dc6628a0f6aa4 (diff)
downloadQt-dabc653c47c3fcdbbe9e59b8e55306bc0a4d8006.zip
Qt-dabc653c47c3fcdbbe9e59b8e55306bc0a4d8006.tar.gz
Qt-dabc653c47c3fcdbbe9e59b8e55306bc0a4d8006.tar.bz2
Fix softkey icon positioning in S60 5.3
In S60 5.3, Avkon apparently expects softkey icons to be 32x32 and positions them accordingly into the softkey, instead of needing the application to supply the whole softkey image. Fixed by skipping the softkey image centering when S60 version is 5.3 or larger. Task-number: QTBUG-19104 Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager_s60.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 79ed91a..0d64d8a 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -176,22 +176,27 @@ void QSoftKeyManagerPrivateS60::setNativeSoftkey(CEikButtonGroupContainer &cba,
QPoint QSoftKeyManagerPrivateS60::softkeyIconPosition(int position, QSize sourceSize, QSize targetSize)
{
QPoint iconPosition(0,0);
- switch( AknLayoutUtils::CbaLocation() )
- {
- case AknLayoutUtils::EAknCbaLocationBottom:
- // RSK must be moved to right, LSK in on correct position by default
- if (position == RSK_POSITION)
- iconPosition.setX(targetSize.width() - sourceSize.width());
- break;
- case AknLayoutUtils::EAknCbaLocationRight:
- case AknLayoutUtils::EAknCbaLocationLeft:
- // Already in correct position
- default:
- break;
- }
- // Align horizontally to center
- iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1);
+ // Prior to S60 5.3 icons need to be properly positioned to buttons, but starting with 5.3
+ // positioning is done on Avkon side.
+ if (QSysInfo::s60Version() < QSysInfo::SV_S60_5_3) {
+ switch (AknLayoutUtils::CbaLocation())
+ {
+ case AknLayoutUtils::EAknCbaLocationBottom:
+ // RSK must be moved to right, LSK in on correct position by default
+ if (position == RSK_POSITION)
+ iconPosition.setX(targetSize.width() - sourceSize.width());
+ break;
+ case AknLayoutUtils::EAknCbaLocationRight:
+ case AknLayoutUtils::EAknCbaLocationLeft:
+ // Already in correct position
+ default:
+ break;
+ }
+
+ // Align horizontally to center
+ iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1);
+ }
return iconPosition;
}