diff -r 12c456ceeff2 -r 5253a20d2a1e emailuis/emailui/src/ncscontrol.cpp --- a/emailuis/emailui/src/ncscontrol.cpp Thu Jan 07 12:38:38 2010 +0200 +++ b/emailuis/emailui/src/ncscontrol.cpp Mon Jan 18 20:08:26 2010 +0200 @@ -22,12 +22,11 @@ #include #include #include +#include #include "ncscontrol.h" #include "FreestyleEmailUiLayoutData.h" -// Plaform layout change #include "ncsutility.h" -// Plaform layout change // --------------------------------------------------------------------------- // MNcsControl::MNcsControl @@ -44,34 +43,22 @@ // CNcsLabel::CNcsLabel // --------------------------------------------------------------------------- // -// Platform layout changes -CNcsLabel::CNcsLabel( const CCoeControl& aParent, MNcsFieldSizeObserver* aSizeObserver ) : +CNcsLabel::CNcsLabel( + const CCoeControl& aParent, + MNcsFieldSizeObserver* aSizeObserver ) : MNcsControl( aSizeObserver ), iParent( aParent ) { FUNC_LOG; UpdateTextColor(); } -// Platform layout changes // --------------------------------------------------------------------------- // CNcsLabel::Reposition // --------------------------------------------------------------------------- // -void CNcsLabel::Reposition( TPoint& aPt, TInt /*aWidth */ ) +void CNcsLabel::Reposition( TPoint& aPt, TInt /*aWidth*/ ) { FUNC_LOG; - // Platform layout changes - /* - TInt ht = Font()->HeightInPixels() + Font()->DescentInPixels(); - ht += 2 * KAifLabelMarginHorizontal; - TSize sz( aWidth, ht ); - if ( Rect() != TRect( aPt, sz ) ) - { - SetExtent( aPt, sz ); - } - aPt.iY += Size().iHeight; - */ - // Platform layout changes SetPosition( aPt ); } @@ -145,5 +132,28 @@ // TInt CNcsLabel::LayoutLineCount() const { + FUNC_LOG; return IsVisible() ? 1 : 0; } + +// --------------------------------------------------------------------------- +// CNcsLabel::TextHitAreaRect +// --------------------------------------------------------------------------- +// +TRect CNcsLabel::TextHitAreaRect() + { + FUNC_LOG; + TRect rect; + if ( Font() && Text() ) + { + rect = Rect(); + rect.SetWidth( Font()->TextWidthInPixels( *Text() ) ); + if( AknLayoutUtils::LayoutMirrored() ) + { + rect.Move( Rect().Size().iWidth - + rect.Size().iWidth - + rect.iTl.iX - 2, 0 ); + } + } + return rect; + }