diff -r aecbbf00d063 -r d48ab3b357f1 uifw/AvKon/src/akntitle.cpp --- a/uifw/AvKon/src/akntitle.cpp Tue Aug 31 15:28:30 2010 +0300 +++ b/uifw/AvKon/src/akntitle.cpp Wed Sep 01 12:16:19 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2008 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" @@ -96,6 +96,8 @@ TBool iImageAutoscaling; TBool iSmallImageAutoscaling; + + CEikStatusPaneBase* iStatusPane; }; @@ -212,6 +214,7 @@ // set flags to default values iExtension->iFlags = 0; } + iExtension->iStatusPane = CEikStatusPaneBase::Current(); } @@ -224,6 +227,7 @@ { CommonConstructL(); ReadFromResourceFileL( aReader ); + iExtension->iStatusPane = CEikStatusPaneBase::Current(); } @@ -676,9 +680,9 @@ // EXPORT_C void CAknTitlePane::Draw( const TRect& aRect ) const { - const TUid KActiveIdle2Uid = {0x102750F0}; - - if ( AppUid() == KActiveIdle2Uid ) + + if ( iExtension->iStatusPane && + iExtension->iStatusPane->IsTransparent() ) { CWindowGc& gc = SystemGc(); TRgb rgb(TRgb::Color16MA(0)); @@ -689,36 +693,42 @@ return; } - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TRect rect( Rect() ); - - CWindowGc& gc=SystemGc(); - - if ( AknStatuspaneUtils::StaconPaneActive() || - AknStatuspaneUtils::FlatLayoutActive() ) + // Don't allow normal background drawing if + // background is already drawn with a background drawer. + const MCoeControlBackground* backgroundDrawer = FindBackground(); + if ( !backgroundDrawer ) { - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - - if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) ) + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TRect rect( Rect() ); + + CWindowGc& gc=SystemGc(); + + if ( AknStatuspaneUtils::StaconPaneActive() || + AknStatuspaneUtils::FlatLayoutActive() ) { - gc.SetPenStyle( CGraphicsContext::ENullPen ); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + + if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) ) + { + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.SetBrushColor( + AKN_LAF_COLOR( KStatusPaneBackgroundGraphicsColorUsual ) ); + gc.DrawRect( rect ); + } + } + else + { gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.SetBrushColor( - AKN_LAF_COLOR( KStatusPaneBackgroundGraphicsColorUsual ) ); - gc.DrawRect( rect ); + gc.SetBrushColor( AKN_LAF_COLOR( KStatusPaneBackgroundColor ) ); + AknsDrawUtils::Background( skin, + AknsDrawUtils::ControlContext( this ), + this, + gc, + rect ); } } - else - { - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.SetBrushColor( AKN_LAF_COLOR( KStatusPaneBackgroundColor ) ); - AknsDrawUtils::Background( skin, - AknsDrawUtils::ControlContext( this ), - this, - gc, - rect ); - } } @@ -908,7 +918,12 @@ TPtr ptr = iText->Des(); AknBidiTextUtils::ConvertToVisualAndWrapToStringL( aText, *iLineWidthArray, *font, ptr, ETrue ); - + + TInt len = iText->Length(); + if (( aLineNum == 1 ) && ( iText->LocateReverseF( '\n' ) == len -1 ) && len >= 1 ) + { + ptr.Delete( len - 1, 1 ); + } } @@ -1430,7 +1445,7 @@ TAknLayoutRect layoutRect; layoutRect.LayoutRect( rect, - AknLayoutScalable_Avkon::title_pane_g2( touchLsc ? 4 : 0 ) ); + AknLayoutScalable_Avkon::title_pane_g2( touchLsc ? 4 : 1 ) ); if ( iExtension->iSmallImageAutoscaling && iExtension->iTitleImage->Bitmap() && @@ -1461,13 +1476,13 @@ { // if image is shown, use shorter version of text oneLineLayout = - AknLayoutScalable_Avkon::title_pane_t1( touchLsc ? 11 : 3 ).LayoutLine(); + AknLayoutScalable_Avkon::title_pane_t1( touchLsc ? 11 : 6 ).LayoutLine(); } else { // if image is not shown, use longer version of text oneLineLayout = - AknLayoutScalable_Avkon::title_pane_t1( touchLsc ? 10 : 2 ).LayoutLine(); + AknLayoutScalable_Avkon::title_pane_t1( touchLsc ? 10 : 5 ).LayoutLine(); } TAknLayoutText oneLineLayoutText;