camerauis/cameraapp/generic/common/src/CamCaptureSetupListItemDrawer.cpp
branchRCL_3
changeset 12 8c55c525d5d7
parent 2 e8773a61782d
child 16 d486e5e3cc9a
--- a/camerauis/cameraapp/generic/common/src/CamCaptureSetupListItemDrawer.cpp	Fri Mar 12 15:41:04 2010 +0200
+++ b/camerauis/cameraapp/generic/common/src/CamCaptureSetupListItemDrawer.cpp	Mon Mar 15 12:39:00 2010 +0200
@@ -54,6 +54,10 @@
 // CONSTANTS
 static const TInt KRadioButtonSelectedIconIndex = 0;
 static const TInt KRadioButtonUnselectedIconIndex = 1;
+//ME:START
+const TUint32 KToolbarExtensionBgColor = 0x00000000;
+const TInt KToolBarExtensionBgAlpha = 0x7F;
+//ME:END
 
 
 // ================= MEMBER FUNCTIONS =======================
@@ -63,11 +67,13 @@
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
+//ME:START
 CCamCaptureSetupListItemDrawer* 
-CCamCaptureSetupListItemDrawer::NewL( MCamListboxModel& aListBoxModel )
+CCamCaptureSetupListItemDrawer::NewL( MCamListboxModel& aListBoxModel, TBool aFullySkinned )
     {
     CCamCaptureSetupListItemDrawer* self = new( ELeave ) 
-                    CCamCaptureSetupListItemDrawer( aListBoxModel );               
+                    CCamCaptureSetupListItemDrawer( aListBoxModel, aFullySkinned );               
+//ME:END
     CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop( self );
@@ -96,8 +102,8 @@
 // -----------------------------------------------------------------------------
 //
 CCamCaptureSetupListItemDrawer
-::CCamCaptureSetupListItemDrawer( MCamListboxModel& aListBoxModel )
-  : iModel( aListBoxModel )
+::CCamCaptureSetupListItemDrawer( MCamListboxModel& aListBoxModel, TBool aFullySkinned )
+  : iModel( aListBoxModel ),iFullySkinned( aFullySkinned )
     {
 	}
 
@@ -220,8 +226,20 @@
         }
 #endif // RD_UI_TRANSITION_EFFECTS_LIST
     // Draw unhighlighted rectangle that encapsulates the item text and bitmap.
-	DrawItemRect( aActualItemRect );       
+    
+    //ME:START
+    PRINT1( _L("Camera <> CCamCaptureSetupListItemDrawer::DrawActualItem iFullySkinned=%d"), iFullySkinned );
 
+    if( iFullySkinned )
+        {
+        DrawItemRect( aActualItemRect );       
+        }
+    else
+        {
+        DrawTransparentItemRect( aActualItemRect );               
+        }	
+    //ME:END
+	
 #ifdef RD_UI_TRANSITION_EFFECTS_LIST   
    	if ( transApi )
    	    {
@@ -273,6 +291,11 @@
         layoutText.LayoutText( aActualItemRect, iTxtLayout );  
         // ...Pass the text to be drawn, into the text layout object
         // ...and draw it.    
+        if( !iFullySkinned )
+            {
+            color=KRgbWhite;       
+            }
+
         layoutText.DrawText( *iGc, iModel.ItemText( aItemIndex ), 
                              ETrue, color );
         // Draw the bitmap.
@@ -304,6 +327,11 @@
         layoutText.LayoutText( aActualItemRect, iTxtWithRbLayout );
         // ...Pass the text to be drawn, into the text layout object
         // ...and draw it.    
+        if( !iFullySkinned )
+            {
+            color=KRgbWhite;       
+            }
+
         layoutText.DrawText( *iGc, iModel.ItemText( aItemIndex ), ETrue, color );
 
         // Draw the bitmap.
@@ -444,6 +472,37 @@
     }
 
 
+//ME:START
+// ---------------------------------------------------------
+// CCamCaptureSetupListItemDrawer::DrawItemRect
+// Draws a rectangle for an item.
+// ---------------------------------------------------------
+//
+void CCamCaptureSetupListItemDrawer::DrawTransparentItemRect( 
+        const TRect& aActualItemRect ) // the rectangular area to be drawn
+        const
+        {
+        const CCoeControl* control = iParentControl;
+        
+        if ( control )
+            {
+            iGc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+            iGc->SetBrushColor( TRgb( KToolbarExtensionBgColor, KToolBarExtensionBgAlpha ) );
+            iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+            iGc->DrawRect( aActualItemRect );            
+            // Reset the brush after use (otherwise anything drawn
+            // after the viewfinder will also show viewfinder frames)    
+            iGc->SetDrawMode( CGraphicsContext::EDrawModePEN );
+            TSize penSize( 1, 1 );
+            iGc->SetPenSize( penSize );
+            iGc->SetPenStyle( CGraphicsContext::EDottedPen );
+            iGc->SetPenColor( KRgbWhite );
+            iGc->SetBrushStyle( CGraphicsContext::ENullBrush );
+            iGc->DrawRect( aActualItemRect );                    
+            }
+        }
+//ME:END
+
 // ---------------------------------------------------------
 // CCamCaptureSetupListItemDrawer::DrawItemRect
 // Draws a rectangle for an item.