822 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
808 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
823 MAknListBoxTfxInternal* transApi = |
809 MAknListBoxTfxInternal* transApi = |
824 CAknListLoader::TfxApiInternal( gc ); |
810 CAknListLoader::TfxApiInternal( gc ); |
825 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
811 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
826 |
812 |
827 if ( transparencyEnabled ) |
813 if ( iWin && iWin->GetDrawRect() == TRect::EUninitialized ) |
828 { |
814 { |
829 if ( iWin && iWin->GetDrawRect() == TRect::EUninitialized ) |
|
830 { |
|
831 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
815 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
832 drawingInitiated = transApi && !transApi->EffectsDisabled(); |
816 drawingInitiated = transApi && !transApi->EffectsDisabled(); |
833 #else |
817 #else |
834 drawingInitiated = EFalse; |
818 drawingInitiated = EFalse; |
835 #endif |
819 #endif |
836 } |
820 } |
837 |
821 |
838 if ( !drawingInitiated ) |
822 if ( !drawingInitiated ) |
839 { |
823 { |
840 iWin->Invalidate( *aClipRect ); |
824 iWin->Invalidate( *aClipRect ); |
841 iWin->BeginRedraw( *aClipRect ); |
825 iWin->BeginRedraw( *aClipRect ); |
842 } |
826 } |
843 } |
|
844 |
827 |
845 TInt lastPotentialItemIndex = |
828 TInt lastPotentialItemIndex = |
846 Min( numberOfItems, |
829 Min( numberOfItems, |
847 iTopItemIndex + NumberOfItemsThatFitInRect( iViewRect ) ); |
830 iTopItemIndex + NumberOfItemsThatFitInRect( iViewRect ) ); |
848 |
831 |
|
832 gc->SetClippingRect( iViewRect ); |
|
833 |
849 while ( i < lastPotentialItemIndex ) |
834 while ( i < lastPotentialItemIndex ) |
|
835 { |
|
836 DrawItem( i++ ); |
|
837 } |
|
838 |
|
839 gc->CancelClippingRect(); |
|
840 |
|
841 if ( control && !static_cast<CEikListBox*>( control )-> |
|
842 BackgroundDrawingSuppressed() ) |
850 { |
843 { |
851 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
844 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
852 if ( transApi ) |
845 if ( transApi ) |
853 { |
846 { |
854 transApi->StartDrawing( MAknListBoxTfxInternal::EListNotSpecified ); |
847 transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); |
855 } |
848 } |
856 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
849 |
857 |
850 if ( i > iBottomItemIndex + 1 ) |
858 gc->SetClippingRect( iViewRect ); |
851 { |
859 |
852 i = iBottomItemIndex + 1; |
860 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
853 } |
861 if ( transApi ) |
854 |
862 { |
855 TRect usedPortionOfViewRect( |
863 transApi->StopDrawing(); |
856 iViewRect.iTl + TSize( 0, iVerticalOffset ), |
864 } |
857 TSize( iViewRect.Width(), ( i - iTopItemIndex ) * iItemHeight ) ); |
865 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
866 |
|
867 DrawItem( i++ ); |
|
868 |
|
869 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
870 if ( transApi ) |
|
871 { |
|
872 transApi->StartDrawing( MAknListBoxTfxInternal::EListNotSpecified ); |
|
873 } |
|
874 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
875 |
|
876 gc->CancelClippingRect(); |
|
877 |
|
878 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
879 if ( transApi ) |
|
880 { |
|
881 transApi->StopDrawing(); |
|
882 } |
|
883 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
884 } |
|
885 |
|
886 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
887 if ( transApi ) |
|
888 { |
|
889 transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); |
|
890 } |
|
891 |
|
892 if ( i > iBottomItemIndex + 1 ) |
|
893 { |
|
894 i = iBottomItemIndex + 1; |
|
895 } |
|
896 |
|
897 TRect usedPortionOfViewRect( |
|
898 iViewRect.iTl + TSize( 0, iVerticalOffset ), |
|
899 TSize( iViewRect.Width(), ( i - iTopItemIndex ) * iItemHeight ) ); |
|
900 #else |
858 #else |
901 // clear the unused portion of the viewing area |
859 // clear the unused portion of the viewing area |
902 TRect usedPortionOfViewRect( iViewRect.iTl.iX, |
860 TRect usedPortionOfViewRect( iViewRect.iTl.iX, |
903 iViewRect.iTl.iY + iVerticalOffset, |
861 iViewRect.iTl.iY + iVerticalOffset, |
904 iViewRect.Width(), |
862 iViewRect.Width(), |
905 ItemPos( lastPotentialItemIndex ).iY ); |
863 ItemPos( lastPotentialItemIndex ).iY ); |
906 |
864 |
907 if ( aClipRect ) |
865 if ( aClipRect ) |
908 { |
866 { |
909 usedPortionOfViewRect.iBr.iX = aClipRect->iBr.iX; |
867 usedPortionOfViewRect.iBr.iX = aClipRect->iBr.iX; |
910 } |
868 } |
911 |
|
912 #endif |
869 #endif |
913 |
870 |
914 // Also draw the area behind scroll bar. |
871 // Also draw the area behind scroll bar. |
915 TRect sbbg( iViewRect ); // whole area behind scroll bar |
872 TRect sbbg( iViewRect ); // whole area behind scroll bar |
916 |
873 |
917 if ( AknLayoutUtils::LayoutMirrored() ) |
874 if ( AknLayoutUtils::LayoutMirrored() ) |
918 { |
875 { |
919 _AKNTRACE("CFormattedCellListBoxView::Draw Layout mirrored"); |
876 _AKNTRACE("CFormattedCellListBoxView::Draw Layout mirrored"); |
920 sbbg.iBr.iX = iViewRect.iBr.iX - itemDrawer->LafItemSize().iWidth; |
877 sbbg.iBr.iX = iViewRect.iBr.iX - itemDrawer->LafItemSize().iWidth; |
921 } |
878 } |
922 else |
879 else |
923 { |
880 { |
924 sbbg.iTl.iX = iViewRect.iTl.iX + itemDrawer->LafItemSize().iWidth; |
881 sbbg.iTl.iX = iViewRect.iTl.iX + itemDrawer->LafItemSize().iWidth; |
925 } |
882 } |
926 |
883 |
927 // Unused portion will be cleared only if listbox background is drawn. |
884 // Unused portion will be cleared only if listbox background is drawn. |
928 if ( itemDrawer->ColumnData()->IsBackgroundDrawingEnabled() ) |
885 if ( itemDrawer->ColumnData()->IsBackgroundDrawingEnabled() ) |
929 { |
886 { |
930 if ( control ) |
887 if ( control ) |
931 { |
|
932 if ( !control->FindBackground() ) |
|
933 { |
888 { |
934 AknsDrawUtils::BackgroundBetweenRects( skin, |
889 if ( !control->FindBackground() ) |
935 cc, |
|
936 control, |
|
937 *gc, |
|
938 iViewRect, |
|
939 usedPortionOfViewRect ); |
|
940 |
|
941 if ( !sbbg.IsEmpty() ) |
|
942 { |
890 { |
943 AknsDrawUtils::Background( skin, |
891 AknsDrawUtils::BackgroundBetweenRects( skin, |
944 cc, |
892 cc, |
945 control, |
893 control, |
946 *gc, |
894 *gc, |
947 sbbg ); |
895 iViewRect, |
|
896 usedPortionOfViewRect ); |
|
897 |
|
898 if ( !sbbg.IsEmpty() ) |
|
899 { |
|
900 AknsDrawUtils::Background( skin, |
|
901 cc, |
|
902 control, |
|
903 *gc, |
|
904 sbbg ); |
|
905 } |
948 } |
906 } |
949 } |
907 } |
950 } |
908 else |
951 else |
909 { |
952 { |
910 gc->SetBrushColor( BackColor() ); |
953 gc->SetBrushColor( BackColor() ); |
911 DrawUtils::ClearBetweenRects( *gc, |
954 DrawUtils::ClearBetweenRects( *gc, |
912 iViewRect, |
955 iViewRect, |
913 usedPortionOfViewRect ); |
956 usedPortionOfViewRect ); |
914 gc->Clear( sbbg ); |
957 gc->Clear( sbbg ); |
915 } |
958 } |
916 } |
959 } |
|
960 |
917 |
961 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
918 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
962 if ( transApi ) |
919 if ( transApi ) |
963 { |
920 { |
964 transApi->StopDrawing(); |
921 transApi->StopDrawing(); |
965 } |
922 } |
966 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
923 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
967 |
924 |
968 |
925 } |
969 if ( transparencyEnabled && !drawingInitiated ) |
926 |
|
927 if ( !drawingInitiated ) |
970 { |
928 { |
971 iWin->EndRedraw(); |
929 iWin->EndRedraw(); |
972 } |
930 } |
973 } |
931 } |
974 _AKNTRACE_FUNC_EXIT; |
932 _AKNTRACE_FUNC_EXIT; |
1385 if ( backgroundDrawer ) |
1349 if ( backgroundDrawer ) |
1386 { |
1350 { |
1387 backgroundDrawer->Draw( *iGc, *control, aItemTextRect ); |
1351 backgroundDrawer->Draw( *iGc, *control, aItemTextRect ); |
1388 bgDrawn = ETrue; |
1352 bgDrawn = ETrue; |
1389 } |
1353 } |
1390 else if ( CAknEnv::Static()->TransparencyEnabled() ) |
1354 else |
1391 { |
1355 { |
1392 bgDrawn = AknsDrawUtils::Background( |
1356 bgDrawn = AknsDrawUtils::Background( |
1393 skin, cc, control, *iGc, aItemTextRect, |
1357 skin, cc, control, *iGc, aItemTextRect, |
1394 KAknsDrawParamNoClearUnderImage ); |
1358 KAknsDrawParamNoClearUnderImage ); |
1395 } |
1359 } |
1396 else |
|
1397 { |
|
1398 bgDrawn = AknsDrawUtils::Background( |
|
1399 skin, cc, control, *iGc, aItemTextRect, |
|
1400 KAknsDrawParamNoClearUnderImage | |
|
1401 KAknsDrawParamBottomLevelRGBOnly ); |
|
1402 } |
|
1403 } |
1360 } |
1404 if ( !bgDrawn ) |
1361 if ( !bgDrawn ) |
1405 { |
1362 { |
1406 iGc->Clear( aItemTextRect ); |
1363 iGc->Clear( aItemTextRect ); |
1407 } |
1364 } |