idlehomescreen/widgetmanager/src/wmportalbutton.cpp
branchRCL_3
changeset 17 b8fae6b8a148
parent 11 ff572dfe6d86
child 18 d05a55b217df
equal deleted inserted replaced
12:9674c1a575e9 17:b8fae6b8a148
   523     
   523     
   524     aGc.UseFont( font );
   524     aGc.UseFont( font );
   525     
   525     
   526     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   526     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   527     
   527     
   528     TRgb textColor( layoutText.Color() );
   528     TRgb textColor;
   529 
   529     TInt err = AknsUtils::GetCachedColor( 
   530     if ( IsDimmed() )
   530                     skin, 
   531         {
   531                     textColor, 
   532         const TInt KAlpha = 77;
   532                     KAknsIIDQsnTextColors, 
   533         textColor = iEikonEnv->ControlColor( EColorButtonText, *this );        
   533                     EAknsCIQsnTextColorsCG63 );
   534         // try over-writing color from theme, ignore error.
   534     if ( err != KErrNone )
   535         AknsUtils::GetCachedColor( 
   535         {
   536                 skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
   536         textColor = layoutText.Color(); 
   537         textColor.SetAlpha( KAlpha );
       
   538         }
       
   539     else if ( IsFocused() || iButtonPressed )
       
   540         {
       
   541         textColor = iEikonEnv->ControlColor( EColorButtonTextPressed, *this );
       
   542         // try over-writing color from theme, ignore error.
       
   543         AknsUtils::GetCachedColor( 
       
   544                 skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 );
       
   545         }
       
   546     else if ( textColor.Internal() <= 0 )
       
   547         {
       
   548         textColor = iEikonEnv->ControlColor( EColorButtonText, *this );
       
   549         // try over-writing color from theme, ignore error.
       
   550         AknsUtils::GetCachedColor( 
       
   551                 skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );        
       
   552         }
       
   553     else
       
   554         {
       
   555         // default for button
       
   556         AknsUtils::GetCachedColor( 
       
   557                 skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG80 ); 
       
   558         }
   537         }
   559     aGc.SetPenColor( textColor);
   538     aGc.SetPenColor( textColor);
   560     
   539     
   561     // Layout data not correct, add some space for text
   540     // Layout data not correct, add some space for text
   562     textRect.iBr.iX += aMargin;
   541     textRect.iBr.iX += aMargin;