uifw/AvKon/src/AknTransparentCameraSettingPage.cpp
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 15 08e69e956a8c
--- a/uifw/AvKon/src/AknTransparentCameraSettingPage.cpp	Tue Feb 02 01:00:49 2010 +0200
+++ b/uifw/AvKon/src/AknTransparentCameraSettingPage.cpp	Fri Feb 19 23:04:46 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,6 @@
 *
 */
 
-
 #include "AknTransparentCameraSettingPage.h"
 
 // For icon support
@@ -173,6 +172,15 @@
     BaseConstructL( KAknSettingPageNoEmbeddedSoftKeys );
     
     SetDrawBackground(EFalse);  // Enable transparent drawing
+    if( CAknEnv::Static()->TransparencyEnabled() )
+        {
+        // try to enable window transparency
+        if ( Window().SetTransparencyAlphaChannel() == KErrNone )
+            {
+            Window().SetRequiredDisplayMode( EColor16MA );
+            Window().SetBackgroundColor( ~0 );
+            }
+        }
     
     GenerateInternalArrayAndGiveToListBoxL();
     
@@ -383,7 +391,9 @@
             // Only in single click enabled applications.
             if ( iExtension &&
                  iExtension->iFlags.IsSet(
-                         CAknTransparentCameraSettingPageExtension::ESingleClickEnabled ) )
+                     CAknTransparentCameraSettingPageExtension::ESingleClickEnabled ) &&
+                 iCurrentSelectionIndex >= 0 &&
+                 iCurrentSelectionIndex < ListBoxControl()->Model()->NumberOfItems() )
                 {
                 ListBoxControl()->View()->SetCurrentItemIndex(
                     iCurrentSelectionIndex );
@@ -544,13 +554,6 @@
                                            parentRect,                                       
                                            KAknsDrawParamDefault);
             }
-        else
-            {
-            gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-            gc.SetPenStyle(CGraphicsContext::ENullPen);
-            gc.SetBrushColor(KRgbWhite);
-            gc.DrawRect (bgRect);
-            }
         }
         
     // draw viewfinder if available