summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qaction.cpp4
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp19
2 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 4b7d949..8ddd051 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -715,6 +715,10 @@ QActionGroup *QAction::actionGroup() const
it is displayed to the left of the menu text. There is no default
icon.
+ On Symbian the icons which are passed to softkeys, i.e. to actions with
+ softkey role, need to have pixmap alpha channel correctly set otherwise
+ drawing artifacts will appear when softkey is pressed down.
+
If a null icon (QIcon::isNull() is passed into this function,
the icon of the action is cleared.
*/
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index a72d16c..af84a8f 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -237,21 +237,18 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba,
// prepareSoftkeyPixmap creates a new pixmap with requiredIconSize and blits the 'pmWihtAspectRatio'
// to correct location of it
QPixmap softkeyPixmap = prepareSoftkeyPixmap(pmWihtAspectRatio, position, requiredIconSize);
- QBitmap softkeyMask = softkeyPixmap.mask();
- if (softkeyMask.isNull()) {
- softkeyMask = QBitmap(softkeyPixmap.size());
- softkeyMask.fill(Qt::color1);
- }
- // Softkey mask in > SV_S60_5_1 has to be inverted
- if(QSysInfo::s60Version() > QSysInfo::SV_S60_5_1) {
- QImage maskImage = softkeyMask.toImage();
- maskImage.invertPixels();
- softkeyMask = QPixmap::fromImage(maskImage);
+ QPixmap softkeyAlpha = softkeyPixmap.alphaChannel();
+ // Alpha channel in 5.1 and older devices need to be inverted
+ // TODO: Switch to use toSymbianCFbsBitmap with invert when available
+ if(QSysInfo::s60Version() <= QSysInfo::SV_S60_5_1) {
+ QImage alphaImage = softkeyAlpha.toImage();
+ alphaImage.invertPixels();
+ softkeyAlpha = QPixmap::fromImage(alphaImage);
}
CFbsBitmap* nBitmap = softkeyPixmap.toSymbianCFbsBitmap();
- CFbsBitmap* nMask = softkeyMask.toSymbianCFbsBitmap();
+ CFbsBitmap* nMask = softkeyAlpha.toSymbianCFbsBitmap();
CEikImage* myimage = new (ELeave) CEikImage;
myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered