uifw/EikStd/coctlsrc/akntoolbarextensionview.cpp
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 16 71dd06cfe933
child 23 3d340a0166ff
equal deleted inserted replaced
16:71dd06cfe933 18:0aa5fbdfbc30
   485                     {
   485                     {
   486                     TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL(
   486                     TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL(
   487                         *button, EColorControlBackground, KRgbWhite ) );
   487                         *button, EColorControlBackground, KRgbWhite ) );
   488                     TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( 
   488                     TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( 
   489                         *button, EColorButtonText, KRgbBlack ) );
   489                         *button, EColorButtonText, KRgbBlack ) );
   490                     }
   490                     }               
   491                 }
   491                 else 
   492             }
   492                     {
   493         }
   493                     //Reset the pressed down text color when get the skin change message and 
   494 
   494                     // KAknTbExtensionDsaMode isn't used.
   495 
   495                     TRgb pressDownColor;
       
   496                     if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), 
       
   497                             pressDownColor, KAknsIIDQsnTextColors, 
       
   498                             EAknsCIQsnTextColorsCG11 ) == KErrNone )
       
   499                         {
       
   500                         TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( *button, 
       
   501                                     EColorButtonTextPressed, pressDownColor ) );                        
       
   502                         }               
       
   503                     }
       
   504                 }
       
   505             }
       
   506         }
   496 
   507 
   497     // Remember to check here if iSelectedItem still is in iVisibleItems, and if 
   508     // Remember to check here if iSelectedItem still is in iVisibleItems, and if 
   498     // not then do something. 
   509     // not then do something. 
   499     if ( ( aType == KAknsMessageSkinChange || 
   510     if ( ( aType == KAknsMessageSkinChange || 
   500         aType == KEikDynamicLayoutVariantSwitch ) && IsVisible() )
   511         aType == KEikDynamicLayoutVariantSwitch ) && IsVisible() )
   768     TBool useOutline = iExtension->ExtensionFlags() & KAknTbExtensionDsaMode;  
   779     TBool useOutline = iExtension->ExtensionFlags() & KAknTbExtensionDsaMode;  
   769     const CFont* font = AknLayoutUtils::FontFromId( AknLayoutScalable_Avkon::
   780     const CFont* font = AknLayoutUtils::FontFromId( AknLayoutScalable_Avkon::
   770         cell_tb_ext_pane_t1( useOutline ? 0 : 1 ).LayoutLine().FontId() );
   781         cell_tb_ext_pane_t1( useOutline ? 0 : 1 ).LayoutLine().FontId() );
   771 
   782 
   772     aButton.SetTextFont( font ); 
   783     aButton.SetTextFont( font ); 
   773     aButton.SetTextColorIds( KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG60 );
   784     aButton.SetTextColorIds( KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG20 );
   774 
   785     
       
   786     
       
   787     //Using CAknButton default frame if KAknTbExtensionTransparent 
       
   788     //and KAknTbExtensionDsaMode are not defined.
       
   789     if ( !( iExtension->ExtensionFlags() & KAknTbExtensionTransparent  ||
       
   790             iExtension->ExtensionFlags() & KAknTbExtensionDsaMode ) ) 
       
   791         {
       
   792         aButton.SetFrameAndCenterIds(
       
   793                 KAknsIIDQsnFrButtonNormal, KAknsIIDQsnFrButtonCenterNormal,
       
   794                 KAknsIIDQsnFrButtonPressed, KAknsIIDQsnFrButtonCenterPressed,
       
   795                 KAknsIIDQsnFrButtonInactive, KAknsIIDQsnFrButtonCenterInactive, 
       
   796                 KAknsIIDQsnFrGrid, KAknsIIDQsnFrGridCenter,
       
   797                 KAknsIIDQsnFrButtonInactive, KAknsIIDQsnFrButtonCenterInactive );
       
   798         }
       
   799     
   775     if ( iExtension->ExtensionFlags() & KAknTbExtensionDsaMode )
   800     if ( iExtension->ExtensionFlags() & KAknTbExtensionDsaMode )
   776         {
   801         {
   777         AknLayoutUtils::OverrideControlColorL( aButton, 
   802         AknLayoutUtils::OverrideControlColorL( aButton, 
   778             EColorControlBackground, KRgbWhite );
   803             EColorControlBackground, KRgbWhite );
   779         AknLayoutUtils::OverrideControlColorL( aButton, 
   804         AknLayoutUtils::OverrideControlColorL( aButton, 
   780             EColorButtonText, KRgbBlack );
   805             EColorButtonText, KRgbBlack );
       
   806         }
       
   807     else
       
   808         {
       
   809         //Reset the pressed down text color when get the skin change message and 
       
   810         // KAknTbExtensionDsaMode isn't used.
       
   811         TRgb pressDownColor;
       
   812         if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), pressDownColor, 
       
   813                 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 ) == KErrNone )
       
   814             {
       
   815             AknLayoutUtils::OverrideControlColorL( aButton, 
       
   816                     EColorButtonTextPressed, pressDownColor );        
       
   817             }
   781         }
   818         }
   782     }
   819     }
   783 
   820 
   784 
   821 
   785 
   822