menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp
branchRCL_3
changeset 28 d721605b30d0
parent 26 1b758917cafc
equal deleted inserted replaced
26:1b758917cafc 28:d721605b30d0
   305         TMmFloatingItemType type = iFloatingItems[i].GetFloatingItemType();
   305         TMmFloatingItemType type = iFloatingItems[i].GetFloatingItemType();
   306         if( iFloatingItems[i].IsFloatingItemValid() )
   306         if( iFloatingItems[i].IsFloatingItemValid() )
   307             {
   307             {
   308             TInt drawnItemIndex = iFloatingItems[i].GetDrawnItemIndex();
   308             TInt drawnItemIndex = iFloatingItems[i].GetDrawnItemIndex();
   309             TSize size = iWidget->View()->ItemSize( drawnItemIndex );
   309             TSize size = iWidget->View()->ItemSize( drawnItemIndex );
   310             TRect rect( iFloatingItems[i].GetItemPosition(), iFloatingItems[i].GetItemPosition() + size);
   310             if ( iWidgetType == EListbox 
       
   311                     && TemplateLibrary()->GetScrollbarVisibility())
       
   312                 {
       
   313                 size.iWidth -= TemplateLibrary()->ScrollbarWidth();
       
   314                 }
       
   315             TRect rect( iFloatingItems[i].GetItemPosition(),
       
   316                     iFloatingItems[i].GetItemPosition() + size);
   311 
   317 
   312             if( rect.Intersects( currentlyDrawnRect ) )
   318             if( rect.Intersects( currentlyDrawnRect ) )
   313                 {
   319                 {
   314                 TInt tempZoomIconIndex = iZoomIconIndex;
   320                 TInt tempZoomIconIndex = iZoomIconIndex;
   315                 TInt tempZoomRatio = iIconAnimationZoomRatio;
   321                 TInt tempZoomRatio = iIconAnimationZoomRatio;
   996 // -----------------------------------------------------------------------------
  1002 // -----------------------------------------------------------------------------
   997 //
  1003 //
   998 void CMmListBoxItemDrawer::SetDraggedIndexL( TInt aDraggedItemIndex,
  1004 void CMmListBoxItemDrawer::SetDraggedIndexL( TInt aDraggedItemIndex,
   999         TPoint aPoint )
  1005         TPoint aPoint )
  1000     {
  1006     {
  1001     TInt dragFloatingItem = KErrNotFound;
  1007     TInt dragStartFloatingItem( KErrNotFound );
       
  1008     TInt dragFloatingItem( KErrNotFound );
  1002     do
  1009     do
  1003         {
  1010         {
  1004         dragFloatingItem = GetFloatingItemIndex( EDragStart );
  1011         dragStartFloatingItem = GetFloatingItemIndex( EDragStart );
  1005         if( dragFloatingItem == KErrNotFound )
  1012         dragFloatingItem = GetFloatingItemIndex( EDrag );
  1006             dragFloatingItem = GetFloatingItemIndex( EDrag );
  1013         if( dragStartFloatingItem == KErrNotFound )
  1007         if( dragFloatingItem != KErrNotFound )
  1014             dragStartFloatingItem = dragFloatingItem;
  1008             {
  1015         if( dragStartFloatingItem != KErrNotFound )
  1009             TMmFloatingItem & item = GetFloatingItemAtIndex( dragFloatingItem );
  1016             {
  1010 
  1017             TMmFloatingItem & item = GetFloatingItemAtIndex( dragStartFloatingItem );
  1011             TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(),
  1018             TMmFloatingItem postDragRefresh( item.GetDrawnItemIndex(),
  1012                     item.GetItemPosition(), EPostDragRefreshItem,
  1019                     item.GetItemPosition(), EPostDragRefreshItem,
  1013                     MmEffects::KNoAnimationFramesCount, iWidget->View() );
  1020                     MmEffects::KNoAnimationFramesCount, iWidget->View() );
  1014 
  1021 
  1015             if( postDragRefresh.GetItemPosition() != aPoint )
  1022             if( postDragRefresh.GetItemPosition() != aPoint )
  1016                 {
  1023                 {
  1017                 iFloatingItems.Append( postDragRefresh );
  1024                 iFloatingItems.Append( postDragRefresh );
  1018                 }
  1025                 }                
  1019             if( item.GetFloatingItemType() == EDrag )
  1026             }
  1020                 RemoveFloatingItem( dragFloatingItem );
  1027         RemoveFloatingItem( dragFloatingItem );
  1021             }
  1028         }
  1022         }
  1029     while( dragFloatingItem != KErrNotFound );
  1023     while( GetFloatingItemIndex( EDrag ) != KErrNotFound );
       
  1024 
  1030 
  1025     if( aDraggedItemIndex != KErrNotFound )
  1031     if( aDraggedItemIndex != KErrNotFound )
  1026         {
  1032         {
  1027         TMmFloatingItem floatingItem( aDraggedItemIndex, aPoint, EDrag,
  1033         TMmFloatingItem floatingItem( aDraggedItemIndex, aPoint, EDrag,
  1028                 MmEffects::KNoAnimationFramesCount, iWidget->View() );
  1034                 MmEffects::KNoAnimationFramesCount, iWidget->View() );