browserui/browser/FavouritesSrc/BrowserAdaptiveListPopup.cpp
branchRCL_3
changeset 55 08ffbd51e3fd
parent 50 c9249d037530
child 56 3154c14a33db
--- a/browserui/browser/FavouritesSrc/BrowserAdaptiveListPopup.cpp	Tue Apr 27 16:41:18 2010 +0300
+++ b/browserui/browser/FavouritesSrc/BrowserAdaptiveListPopup.cpp	Tue May 11 16:16:13 2010 +0300
@@ -270,7 +270,7 @@
         {
         User::Leave(KErrCouldNotConnect);
         }
-
+    iListScrollTimer = CPeriodic::NewL(CActive::EPriorityIdle);
     }
 
 // ---------------------------------------------------------
@@ -285,6 +285,11 @@
     delete iItemNamesToShow;
     delete iPrevGotoContent;
     delete iFirstGotoContent;
+    if(iListScrollTimer)
+    {
+    iListScrollTimer->Cancel();
+    delete iListScrollTimer;
+    }
 }
 
 // ---------------------------------------------------------
@@ -636,7 +641,13 @@
             AknListBoxLayouts::SetupListboxPos( *iList, AppLayout::list_single_graphic_popup_wml_pane( 0 ));
             }
         //the last item is visible
-        iList->ScrollToMakeItemVisible( iList->Model()->NumberOfItems()-1 );
+        //ScrollToMakeItemVisible scrolls only after some delay        
+        if(!iListScrollTimer->IsActive())
+            {
+	        iListScrollTimer->Start(20, 0, 
+	                TCallBack(ListScrollTimerCallBack, this));
+            }
+                
 #ifdef BRDO_TOUCH_ENABLED_FF
         const CFont* pFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);
         TFontSpec fontSpec = pFont->FontSpecInTwips();
@@ -1293,5 +1304,17 @@
     iMaxRecentUrlsToShow = maxRecentUrls;
     }
 
+TInt CBrowserAdaptiveListPopup::ListScrollTimerCallBack(TAny* aAny)
+    {
+    CBrowserAdaptiveListPopup* self = static_cast<CBrowserAdaptiveListPopup*>( aAny ); 
+    self->DoListScrolling();    
+    self->iListScrollTimer->Cancel();
+    return KErrNone;
+    }
+ 
+void CBrowserAdaptiveListPopup::DoListScrolling()
+    {
+    iList->ScrollToMakeItemVisible( iList->Model()->NumberOfItems()-1 );
+    }
 
 // End of File