Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Skinning the a Symbian app

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


Article Metadata
CompatibilityArticle
Created: User:External 15 (31 Jul 2009)
Last edited: lpvalente (18 May 2014)
ID CS001459 Creation date September 8th, 2009
Platform S60 3rd Edition FP2,
S60 5th Edition
Tested on devices Nokia N78, Nokia 5800 XpressMusic
Category Symbian C++ Subcategory UI, Themes

Contents

Overview

This code can be used to skin the application using MAknsSkinInstance.

MMP file

The following capabilities and libraries are required:

 CAPABILITY ReadUserData
 
LIBRARY aknskins.lib aknskinsrv.lib aknswallpaperutils.lib

Header file

 //includes
#include <aknsutils.h>
#include <AknsItemDef.h>
#include <aknsskininstance.h>

Source file

This code can be used to change the skin background:

 MAknsSkinInstance* skin = AknsUtils::SkinInstance();
TAknsItemID elementID;<br>
//Changing the status pane skin background
elementID.Set(EAknsMajorSkin, EAknsMinorQsnBgAreaStatus);
skin->SetLocalItemDefL(AknsUtils::CreateBitmapItemDefL(elementID,KMbmFileName,EMbmSkinchange_0xe5c4b7eeGray));<br>
//Changing the navi pane skin background
elementID.Set(EAknsMajorAvkon, EAknsMinorQsnBgNavipaneSolid);
skin->SetLocalItemDefL(AknsUtils::CreateBitmapItemDefL(elementID,KMbmFileName,EMbmSkinchange_0xe5c4b7eePink));<br>
//Changing the list background
elementID.Set(EAknsMajorSkin, EAknsMinorQsnBgAreaMainListGene);
skin->SetLocalItemDefL(AknsUtils::CreateBitmapItemDefL(elementID,KMbmFileName,EMbmSkinchange_0xe5c4b7eeGray));
 
//Changing the control pane skin background
elementID.Set(EAknsMajorSkin, EAknsMinorQsnBgAreaControl);
skin->SetLocalItemDefL(AknsUtils::CreateBitmapItemDefL(elementID,KMbmFileName,EMbmSkinchange_0xe5c4b7eeGray));

This code can be used to change the text colors:

 MAknsSkinInstance* skin = AknsUtils::SkinInstance();
CAknsItemData* itemData = skin->GetCachedItemData(KAknsIIDQsnTextColors, EAknsITColorTable);
CAknsColorTableItemData* colorItemData = static_cast<CAknsColorTableItemData*>(itemData);
TAknsColorTableEntry textColors[50];
for (TInt i = 0; i < 50; i++)
{
TUint32 color;
switch (i)
{
case EAknsCIQsnTextColorsCG1: //status area title text
case EAknsCIQsnTextColorsCG2: //navi pane texts
{
color = 0xFF0000;
}
break;<br>
case EAknsCIQsnTextColorsCG3: //active tab text
case EAknsCIQsnTextColorsCG4: //passive tab text
{
color = 0x00FF00;
}
break;<br>
case EAknsCIQsnTextColorsCG10: //list highlight list texts
{
color = 0x00FF00;
}
break;<br>
case EAknsCIQsnTextColorsCG13: //control pane general left softkey text
case EAknsCIQsnTextColorsCG14: //control pane general right softkey text
case EAknsCIQsnTextColorsCG15: //control pane idle left softkey text
case EAknsCIQsnTextColorsCG16: //control pane idle right softkey text
{
color=0xFF0000;
}
break;<br>
default:
{
color = colorItemData->ColorRgb(i).Value();
}
break;
}
 
textColors[i].iIndex=-1;
textColors[i].iRgb=color;
}
colorItemData->SetColorsL(50, textColors);
This page was last modified on 18 May 2014, at 19:11.
52 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×