phoneuis/easydialing/src/easydialinglistbox.cpp
branchRCL_3
changeset 81 c26cc2a7c548
parent 62 5266b1f337bd
--- a/phoneuis/easydialing/src/easydialinglistbox.cpp	Wed Sep 15 12:12:21 2010 +0300
+++ b/phoneuis/easydialing/src/easydialinglistbox.cpp	Wed Oct 13 14:31:22 2010 +0300
@@ -56,6 +56,8 @@
 
 // CONSTANTS
 static const TInt KListBoxMarginWidth = 2;
+static const TInt KMaxVisibleItemsPortrait = 3;
+static const TInt KMaxVisibleItemsLandscape = 2;
 
 // MACROS
 
@@ -382,19 +384,8 @@
     maxViewLayout.LayoutRect( aMaxRect, AknLayoutScalable_Apps::dia3_list_pane( variety ) );
     TRect maxViewRect( maxViewLayout.Rect() );
     maxViewRect.Shrink( KListBoxMarginWidth, KListBoxMarginWidth ); // layout data doens't include any margins but we have added some
-
-    // Read list item size aid from layout data. Use it to determine how many
-    // items to show in listbox.
-    TAknLayoutRect listSizeAid;
-    listSizeAid.LayoutRect( aMaxRect, AknLayoutScalable_Apps::aid_size_list_single_double() );
-    TInt itemHeightAid = listSizeAid.Rect().Height();
     
-    TInt maxItemsShown = maxViewRect.Height() / itemHeightAid;
-    if ( maxViewRect.Height() % itemHeightAid > itemHeightAid / 2 )
-        {
-        maxItemsShown++;
-        }
-    
+    TInt maxItemsShown = ( variety ? KMaxVisibleItemsLandscape : KMaxVisibleItemsPortrait );
     TInt itemHeight = maxViewRect.Height() / maxItemsShown;
     TRAP_IGNORE( SetItemHeightL( itemHeight ) );