emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp
branchRCL_3
changeset 73 c8382f7b54ef
parent 64 3533d4323edc
child 80 726fba06891a
equal deleted inserted replaced
70:968773a0b6ef 73:c8382f7b54ef
   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
   225         iBgBrush = iDefaultBgBrush;
   226         iBgBrush = iDefaultBgBrush;
   226         iButtonLayout->Brushes()->AppendL( iBgBrush, EAlfDoesNotHaveOwnership );
   227         iButtonLayout->Brushes()->AppendL( iBgBrush, EAlfDoesNotHaveOwnership );
   227         UpdateBarLayout();
   228         UpdateBarLayout();
   228         }
   229         }
   229     else if ( iBgColorBrush )
   230     else if ( iBgColorBrush )
   676             {
   677             {
   677             break;
   678             break;
   678             }
   679             }
   679         }
   680         }
   680 
   681 
       
   682     TSize size =  iButtonModel->Size();
       
   683     
   681     // New size for the button background.
   684     // New size for the button background.
   682     iButtonLayout->SetSize( iButtonModel->Size() );
   685     iButtonLayout->SetSize( size );
   683     // Same size for the content
   686     // Same size for the content
   684     iButtonContentLayout->SetSize( iButtonModel->Size() );
   687     iButtonContentLayout->SetSize( size );
   685 
   688 
   686     if( iDefaultBgBrush )
   689     if ( iDefaultBgBrush && size != iLastUpdatedButtonModelSize )
   687         {
   690         {
   688         TSize size =  iButtonModel->Size();
   691         iLastUpdatedButtonModelSize = size;
   689         TRect fullRect = TRect( size );
   692         TRect fullRect = TRect( size );
   690         TRect innerRect = fullRect;
   693         TRect innerRect = fullRect;
   691         innerRect.Shrink( KButtonBorderSize,KButtonBorderSize );
   694         innerRect.Shrink( KButtonBorderSize,KButtonBorderSize );
   692         TRAP_IGNORE(
   695         TRAP_IGNORE(
   693                 iDefaultBgBrush->SetFrameRectsL( innerRect, fullRect ); );
   696                 iDefaultBgBrush->SetFrameRectsL( innerRect, fullRect ); );