imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicondialog.cpp
branchRCL_3
changeset 20 6b620215f837
parent 16 d20aea8a18b6
--- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicondialog.cpp	Tue May 25 12:27:36 2010 +0300
+++ b/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicondialog.cpp	Wed Jun 09 09:27:17 2010 +0300
@@ -82,7 +82,7 @@
 CIMCVAppSmileIconDialog::CIMCVAppSmileIconDialog( 
                             const RPointerArray<CGulIcon>& aIconArray,
 							TInt& aSelectedIconId )
-:iIconArray( aIconArray ), iIconId( aSelectedIconId )
+:iIconArray( aIconArray ), iIconId( aSelectedIconId ), iLayoutChanged(EFalse)
     {
     
     }
@@ -141,8 +141,9 @@
     IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::HandleResourceChange() start") );
     if( aType == KEikDynamicLayoutVariantSwitch )
         {
-        SetLayout();
-        }
+		iLayoutChanged = ETrue;
+		SetLayout();
+        } 
 	CAknDialog::HandleResourceChange( aType );
 	IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::HandleResourceChange() end") );
     }
@@ -391,8 +392,17 @@
             }
         else 
             {
-            vWidth = dialogRect.iBr.iX - dialogRect.iTl.iX + 2*aRect.iBr.iX;
-            }
+			// Patch fix for mirrored layout when mode changes from portrait to
+			// landscape or vice versa the width calculation differs to adjust the correct width
+			if (iLayoutChanged) // mode change like portrait to landscape or vice versa
+				{
+				vWidth = (2*aRect.iBr.iX) - (dialogRect.iBr.iX - dialogRect.iTl.iX);
+				}
+			else
+				{
+				vWidth = dialogRect.iBr.iX - dialogRect.iTl.iX + 2*aRect.iBr.iX;
+				}
+            } 
 		vArea = vWidth*vheight;
 		
 	    TInt iconCount = iIconArray.Count();