diff options
| author | Janne Anttila <janne.anttila@digia.com> | 2010-02-05 12:01:17 (GMT) |
|---|---|---|
| committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-02-08 18:47:26 (GMT) |
| commit | b08bb490821ae9337d5bcf18d5d547e81a0982d2 (patch) | |
| tree | 5299867f304bb1f1bee827f9554a84d26e970cd5 /src/gui/kernel/qsoftkeymanager_s60.cpp | |
| parent | 952a5d0ce1d734a649d89c78b1adb3ebfd50ca75 (diff) | |
| download | Qt-b08bb490821ae9337d5bcf18d5d547e81a0982d2.zip Qt-b08bb490821ae9337d5bcf18d5d547e81a0982d2.tar.gz Qt-b08bb490821ae9337d5bcf18d5d547e81a0982d2.tar.bz2 | |
Fix to S60 softkey pressed down image.
On Symbian the icons which are passed to softkeys, i.e. to actions with
softkey role, need to use pixmap alpha channel instead of mask. Otherwise
S60 CBA framework fails to create 50% transparent pressed down mask for
softkey icon.
Task-number: QTBUG-7314
Review-By: Sami Merila
(cherry picked from commit 95012c3ca7ef52ea8f2a2ecb67987b8575758987)
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager_s60.cpp')
| -rw-r--r-- | src/gui/kernel/qsoftkeymanager_s60.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
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 |
