uifw/eikctl/src/EIKCLB.CPP
branchRCL_3
changeset 10 3d340a0166ff
parent 9 0aa5fbdfbc30
child 12 941195f2d488
--- a/uifw/eikctl/src/EIKCLB.CPP	Tue Apr 27 16:55:05 2010 +0300
+++ b/uifw/eikctl/src/EIKCLB.CPP	Tue May 11 16:27:42 2010 +0300
@@ -594,17 +594,6 @@
     data->SetItemCellSize( iItemCellSize );
     }
 
-void CColumnListBoxItemDrawer::DrawCurrentItemRect(const TRect& aRect) const
-//
-//    Draw the item background
-//
-    {
-    iGc->SetClippingRect(iViewRect);
-    iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-    iGc->SetPenColor(iHighlightedBackColor);    // KDefaultLbxHighlightRectColor
-    iGc->DrawRect(aRect);
-    iGc->CancelClippingRect();
-    }
 
 /**
 * Returns a pointer to the column data. Does not imply transfer of ownership.
@@ -656,6 +645,12 @@
     TInt pos = -1;
 
     TBool removeicon = (!aItemIsSelected && !ItemMarkReverse()) || (aItemIsSelected && ItemMarkReverse());
+    
+    if ( Flags() & CListItemDrawer::EMarkingModeEnabled )
+        {
+        removeicon = EFalse;
+        }
+
     if ( Flags() & EDrawMarkSelection && ItemMarkPosition() != -1 && removeicon)
         {
         repl.Set( ItemMarkReplacement() );
@@ -810,8 +805,15 @@
 #define ITEM_EXISTS_ONCE(x) (((x) > -1) && ((x) < iModel->NumberOfItems()))
 
 EXPORT_C void
-CColumnListBoxView::Draw( const TRect* aRect ) const
+CColumnListBoxView::Draw( const TRect* /*aRect*/ ) const
     {
+    // If we get here background is drawn via avkon implementation -> raise the
+    // corresponding flag in item drawer.
+    if ( iItemDrawer )
+        {
+        iItemDrawer->SetFlags( CListItemDrawer::ENativeImplementation );
+        }
+
     if ( RedrawDisabled() || !IsVisible() )
         {
         return;
@@ -831,28 +833,7 @@
         cc = lbi->ColumnData()->SkinBackgroundContext();
         }
 
-    // Draw the whole background at once, this is faster than drawing
-    // it in separate items.
-    if ( listbox && listbox->BackgroundDrawingSuppressed() )
-        {
-#ifdef RD_UI_TRANSITION_EFFECTS_LIST
-            MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc );
-            if ( transApi )
-                {
-                transApi->StartDrawing( MAknListBoxTfxInternal::EListView );
-                }
-#endif // RD_UI_TRANSITION_EFFECTS_LIST
-
-        AknsDrawUtils::Background( skin, cc, listbox, *iGc, *aRect );
-
-#ifdef RD_UI_TRANSITION_EFFECTS_LIST
-        if ( transApi )
-            {
-            transApi->StopDrawing();
-            }
-#endif // RD_UI_TRANSITION_EFFECTS_LIST
-        }
-    else if ( !listbox )
+    if ( !listbox )
         {
         iGc->Clear();
         }
@@ -860,6 +841,7 @@
     TInt firstPotentialItemIndex = iTopItemIndex;
     TInt lastPotentialItemIndex =
         iTopItemIndex + NumberOfItemsThatFitInRect( iViewRect ) - 1;
+    TBool backgroundDrawingSuppressed = ( listbox && listbox->BackgroundDrawingSuppressed() );
 
     if ( iModel->NumberOfItems() == 0 )
         {
@@ -872,6 +854,11 @@
             lastPotentialItemIndex = iBottomItemIndex;
             }
 
+        if ( backgroundDrawingSuppressed )
+            {
+            iGc->SetClippingRect( iViewRect );
+            }
+
         ITEM_EXISTS_BEGIN;
         for ( i = firstPotentialItemIndex; i <= lastPotentialItemIndex; i++ )
             {
@@ -884,9 +871,14 @@
                 break;
                 }
             }
+
+        if ( backgroundDrawingSuppressed )
+            {
+            iGc->CancelClippingRect();
+            }
         }
 
-    if ( listbox && !listbox->BackgroundDrawingSuppressed() )
+    if ( !backgroundDrawingSuppressed )
         {
         // Clear the unused portion of the viewing area
         // (this handles drawing the vertical line too :)