×
Namespaces

Variants
Actions

Talk:Enable Skin Support in Views/Containers

From Nokia Developer Wiki
Jump to: navigation, search

Amrok90 -

If you use some label and want it's background to be consistent with the theme and with the background of the parent controller, change the parameters in this function:

void CYourAppView::SizeChanged() {

if(iBgContext)
{
   iBgContext->SetRect(Rect());
   if ( &Window() )
       {
       iBgContext->SetParentPos( PositionRelativeToScreen() );
       }
}

}

this way:

1)here

iBgContext->SetRect(Rect());

change to

iBgContext->SetRect(Parent()->Rect());

2)here

iBgContext->SetParentPos( PositionRelativeToScreen() );

change to

iBgContext->SetParentPos( TPoint(0, 0) );

(or here it may be iBgContext->SetParentPos( Parent()->Rect().iTl ); (parent's top left point)).

Amrok90 -

I've tried this code in different situations and found out that setting the rect of background to whole screen is the best option:

CMyAppUi *appUi = (CMyAppUi*)iEikonEnv->AppUi(); iBgContext->SetRect(appUi->ApplicationRect());


In this case the TL has to be 0, 0.

amrok90 12:51, 14 February 2012 (EET)

 
×