emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp
branchRCL_3
changeset 80 726fba06891a
parent 73 c8382f7b54ef
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
   219 void CFsControlButtonVisualiser::UpdateVisualThemeL()
   219 void CFsControlButtonVisualiser::UpdateVisualThemeL()
   220     {
   220     {
   221     if( iUseDefaultBackground )
   221     if( iUseDefaultBackground )
   222         {
   222         {
   223         ClearBackgroundImage();
   223         ClearBackgroundImage();
   224         iDefaultBgBrush = CAlfFrameBrush::NewL( iParent->Env(), KAknsIIDQsnFrButtonTb );
   224         iDefaultBgBrush = CAlfFrameBrush::NewL( iParent->Env(), KAknsIIDQsnFrButtonTb );  
   225         iLastUpdatedButtonModelSize.SetSize(0,0); // prevent code skip in ClearBackgroundImage
       
   226         iBgBrush = iDefaultBgBrush;
   225         iBgBrush = iDefaultBgBrush;
   227         iButtonLayout->Brushes()->AppendL( iBgBrush, EAlfDoesNotHaveOwnership );
   226         iButtonLayout->Brushes()->AppendL( iBgBrush, EAlfDoesNotHaveOwnership );
   228         UpdateBarLayout();
   227         UpdateBarLayout();
   229         }
   228         }
   230     else if ( iBgColorBrush )
   229     else if ( iBgColorBrush )
   677             {
   676             {
   678             break;
   677             break;
   679             }
   678             }
   680         }
   679         }
   681 
   680 
   682     TSize size =  iButtonModel->Size();
       
   683     
       
   684     // New size for the button background.
   681     // New size for the button background.
   685     iButtonLayout->SetSize( size );
   682     iButtonLayout->SetSize( iButtonModel->Size() );
   686     // Same size for the content
   683     // Same size for the content
   687     iButtonContentLayout->SetSize( size );
   684     iButtonContentLayout->SetSize( iButtonModel->Size() );
   688 
   685 
   689     if ( iDefaultBgBrush && size != iLastUpdatedButtonModelSize )
   686     if( iDefaultBgBrush )
   690         {
   687         {
   691         iLastUpdatedButtonModelSize = size;
   688         TSize size =  iButtonModel->Size();
   692         TRect fullRect = TRect( size );
   689         TRect fullRect = TRect( size );
   693         TRect innerRect = fullRect;
   690         TRect innerRect = fullRect;
   694         innerRect.Shrink( KButtonBorderSize,KButtonBorderSize );
   691         innerRect.Shrink( KButtonBorderSize,KButtonBorderSize );
   695         TRAP_IGNORE(
   692         TRAP_IGNORE(
   696                 iDefaultBgBrush->SetFrameRectsL( innerRect, fullRect ); );
   693                 iDefaultBgBrush->SetFrameRectsL( innerRect, fullRect ); );