Commit 95012c3ca7ef52ea8f2a2ecb67987b8575758987
- Diff rendering mode:
- inline
- side by side
src/gui/kernel/qaction.cpp
(4 / 0)
|   | |||
| 715 | 715 | it is displayed to the left of the menu text. There is no default | |
| 716 | 716 | icon. | |
| 717 | 717 | ||
| 718 | On Symbian the icons which are passed to softkeys, i.e. to actions with | ||
| 719 | softkey role, need to have pixmap alpha channel correctly set otherwise | ||
| 720 | drawing artifacts will appear when softkey is pressed down. | ||
| 721 | |||
| 718 | 722 | If a null icon (QIcon::isNull() is passed into this function, | |
| 719 | 723 | the icon of the action is cleared. | |
| 720 | 724 | */ |
src/gui/kernel/qsoftkeymanager_s60.cpp
(8 / 11)
|   | |||
| 237 | 237 | // prepareSoftkeyPixmap creates a new pixmap with requiredIconSize and blits the 'pmWihtAspectRatio' | |
| 238 | 238 | // to correct location of it | |
| 239 | 239 | QPixmap softkeyPixmap = prepareSoftkeyPixmap(pmWihtAspectRatio, position, requiredIconSize); | |
| 240 | QBitmap softkeyMask = softkeyPixmap.mask(); | ||
| 241 | if (softkeyMask.isNull()) { | ||
| 242 | softkeyMask = QBitmap(softkeyPixmap.size()); | ||
| 243 | softkeyMask.fill(Qt::color1); | ||
| 244 | } | ||
| 245 | 240 | ||
| 246 | // Softkey mask in > SV_S60_5_1 has to be inverted | ||
| 247 | if(QSysInfo::s60Version() > QSysInfo::SV_S60_5_1) { | ||
| 248 | QImage maskImage = softkeyMask.toImage(); | ||
| 249 | maskImage.invertPixels(); | ||
| 250 | softkeyMask = QPixmap::fromImage(maskImage); | ||
| 241 | QPixmap softkeyAlpha = softkeyPixmap.alphaChannel(); | ||
| 242 | // Alpha channel in 5.1 and older devices need to be inverted | ||
| 243 | // TODO: Switch to use toSymbianCFbsBitmap with invert when available | ||
| 244 | if(QSysInfo::s60Version() <= QSysInfo::SV_S60_5_1) { | ||
| 245 | QImage alphaImage = softkeyAlpha.toImage(); | ||
| 246 | alphaImage.invertPixels(); | ||
| 247 | softkeyAlpha = QPixmap::fromImage(alphaImage); | ||
| 251 | 248 | } | |
| 252 | 249 | ||
| 253 | 250 | CFbsBitmap* nBitmap = softkeyPixmap.toSymbianCFbsBitmap(); | |
| 254 | CFbsBitmap* nMask = softkeyMask.toSymbianCFbsBitmap(); | ||
| 251 | CFbsBitmap* nMask = softkeyAlpha.toSymbianCFbsBitmap(); | ||
| 255 | 252 | ||
| 256 | 253 | CEikImage* myimage = new (ELeave) CEikImage; | |
| 257 | 254 | myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

