diff -r 1d7827e39b52 -r caea42e26caa messagingappbase/mce/src/MceMainViewEmptyListContainer.cpp --- a/messagingappbase/mce/src/MceMainViewEmptyListContainer.cpp Fri Feb 19 22:47:38 2010 +0200 +++ b/messagingappbase/mce/src/MceMainViewEmptyListContainer.cpp Fri Mar 12 15:42:19 2010 +0200 @@ -19,8 +19,10 @@ // INCLUDE FILES -#include +#include #include +#include +#include #include "MceMainViewEmptyListContainer.h" @@ -36,6 +38,8 @@ // Symbian OS default constructor can leave. void CMceMainViewEmptyListContainer::ConstructL( const TRect& aRect ) { + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMainMessage, aRect, ETrue); CreateWindowL(); SetRect( aRect ); ActivateL(); @@ -56,6 +60,7 @@ // Destructor CMceMainViewEmptyListContainer::~CMceMainViewEmptyListContainer() { + delete iBgContext; } @@ -68,7 +73,30 @@ { return EKeyWasConsumed; } - +// --------------------------------------------------------- +// CMceMainViewEmptyListContainer::MopSupplyObject +// --------------------------------------------------------- +// +TTypeUid::Ptr CMceMainViewEmptyListContainer::MopSupplyObject(TTypeUid aId) + { + if (aId.iUid == MAknsControlContext::ETypeId) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject(aId); + } +// --------------------------------------------------------- +// CMceMainViewEmptyListContainer::SizeChanged +// --------------------------------------------------------- +// +void CMceMainViewEmptyListContainer::SizeChanged() + { + if ( iBgContext ) + { + iBgContext->SetRect( Rect() ); + iBgContext->SetParentPos( PositionRelativeToScreen() ); + } + } // --------------------------------------------------------- // CMceMainViewEmptyListContainer::Draw // --------------------------------------------------------- @@ -76,10 +104,19 @@ void CMceMainViewEmptyListContainer::Draw(const TRect& /*aRect*/ ) const { CWindowGc& gc = SystemGc(); - gc.SetPenColor( AKN_LAF_COLOR ( 0 ) ); // background - gc.SetPenStyle( CGraphicsContext::ESolidPen ); - gc.SetPenSize( TSize(0,0) ); // no border needed here - gc.DrawRect( Rect() ); + TRect aRect = Rect(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + + if( !AknsDrawUtils::Background( skin, cc, this, gc, aRect ) ) + { + // Same as CCoeControl draw for blank controls + CGraphicsContext& gcBlank = SystemGc(); + gcBlank.SetPenStyle( CGraphicsContext::ENullPen ); + gcBlank.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gcBlank.DrawRect( aRect ); + } + } // End of File