285 // CBatteryPopupControl::Draw |
285 // CBatteryPopupControl::Draw |
286 // ----------------------------------------------------------------------------- |
286 // ----------------------------------------------------------------------------- |
287 // |
287 // |
288 void CBatteryPopupControl::Draw( const TRect& /*aRect*/ ) const |
288 void CBatteryPopupControl::Draw( const TRect& /*aRect*/ ) const |
289 { |
289 { |
290 FUNC_LOG |
290 FUNC_LOG |
291 |
291 |
292 CWindowGc& gc = SystemGc(); |
292 CWindowGc& gc = SystemGc(); |
293 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
293 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
294 |
294 |
295 if( iIcon ) |
295 if( iIcon ) |
296 { |
296 { |
297 CFbsBitmap* bmp = NULL; |
|
298 TRgb color( KRgbWhite ); // Default never used |
297 TRgb color( KRgbWhite ); // Default never used |
299 bmp = AknsUtils::GetCachedBitmap( skin, KAknsIIDQsnComponentColorBmpCG2 ); |
298 |
300 AknsUtils::GetCachedColor( skin, color, |
299 AknsUtils::GetCachedColor( skin, color, |
301 KAknsIIDQsnComponentColors, EAknsCIQsnComponentColorsCG2 ); |
300 KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG6 ); |
302 |
301 |
303 AknIconUtils::SetSize( iIcon->Mask(), iBitmapLayout.Rect().Size() ); |
302 if (AknIconUtils::IsMifIcon(iIcon->Bitmap())) |
304 if ( bmp ) |
303 { |
305 { |
304 AknIconUtils::SetIconColor( iIcon->Bitmap(), color ); |
306 iBitmapLayout.DrawImage( gc, bmp, iIcon->Mask() ); |
305 } |
307 } |
306 |
308 else |
307 AknIconUtils::SetSize( iIcon->Bitmap(), iBitmapLayout.Rect().Size() ); |
309 { |
308 iBitmapLayout.DrawImage( gc, iIcon->Bitmap(), iIcon->Mask() ); |
310 AknIconUtils::SetSize( iIcon->Bitmap(), iBitmapLayout.Rect().Size() ); |
309 |
311 bmp = iIcon->Bitmap(); |
310 gc.Reset(); |
312 iBitmapLayout.DrawImage( gc, bmp, iIcon->Mask() ); |
311 } |
313 } |
312 |
314 gc.Reset(); |
313 gc.SetPenStyle( CGraphicsContext::ESolidPen ); |
315 } |
314 const CFont* font = iFont; |
|
315 if ( !font ) |
|
316 { |
|
317 font = iCoeEnv->NormalFont(); |
|
318 } |
|
319 gc.UseFont( font ); |
|
320 |
|
321 if(iText) |
|
322 { |
|
323 TRect rect( iLinkRect ); |
|
324 TRgb textContentColor; |
|
325 TInt err = AknsUtils::GetCachedColor( skin, textContentColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); |
|
326 |
|
327 if (!err) |
|
328 { |
|
329 TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( *iText, |
|
330 EColorLabelText, textContentColor ) ); |
|
331 } |
|
332 |
|
333 gc.SetPenColor( textContentColor ); |
|
334 |
|
335 TInt textBaseLineOffset = 0; |
|
336 textBaseLineOffset = (rect.Height() - font->FontMaxHeight())/2; |
|
337 gc.DrawText( *(iText->Text()), rect, textBaseLineOffset, CGraphicsContext::ELeft ); |
|
338 //gc.Reset(); |
|
339 |
|
340 } |
|
341 |
316 TRgb textColor; |
342 TRgb textColor; |
317 AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnHighlightColors, |
343 AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnHighlightColors, |
318 EAknsCIQsnHighlightColorsCG3 ); |
344 EAknsCIQsnHighlightColorsCG3 ); |
319 |
345 |
320 gc.SetPenStyle( CGraphicsContext::ESolidPen ); |
|
321 gc.SetPenColor( textColor ); |
346 gc.SetPenColor( textColor ); |
322 |
|
323 const CFont* font = iFont; |
|
324 if ( !font ) |
|
325 { |
|
326 font = iCoeEnv->NormalFont(); |
|
327 } |
|
328 gc.UseFont( font ); |
|
329 |
|
330 gc.SetUnderlineStyle( EUnderlineOn ); |
347 gc.SetUnderlineStyle( EUnderlineOn ); |
331 if(iLinkText) |
348 if(iLinkText) |
332 { |
349 { |
333 TRect rect( iLinkRect ); |
350 TRect rect( iLinkRect ); |
334 if ( Background() ) |
351 if ( Background() ) |