diff -r b13141f05c3d -r b5fbb9b25d57 meetingrequest/mrgui/src/cesmrview.cpp --- a/meetingrequest/mrgui/src/cesmrview.cpp Tue Apr 27 16:20:14 2010 +0300 +++ b/meetingrequest/mrgui/src/cesmrview.cpp Tue May 11 15:57:15 2010 +0300 @@ -15,10 +15,6 @@ * */ -// custom sw help files not avilable in Cmail -//#include //for custom_sw helps -//#include //for custom_sw helps -// #include "cesmrview.h" #include "mesmrmeetingrequestentry.h" #include "esmrinternaluid.h" @@ -40,17 +36,17 @@ #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -62,10 +58,6 @@ #include "emailtrace.h" - -// Removed profiling. - - // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -214,7 +206,7 @@ delete iAttachmentIndicator; iAttachmentIndicator = NULL; - ReLayout(); + SizeChanged(); } } break; @@ -317,9 +309,7 @@ else { // Only viewer from Mail supported - // TODO: Change to KFS_VIEWER_HLP_MR_RECEIVED - // when help id is released on wk9 platform - LaunchHelpL( KFS_VIEWER_HLP_MEETING_REQ_VIEW ); + LaunchHelpL( KFS_VIEWER_HLP_MR_RECEIVED ); } } else if ( mrEntry->RoleL() == EESMRRoleOrganizer ) @@ -664,8 +654,13 @@ { return; } - - TRect containerRect( Rect() ); + + // Remove possible intersection with toolbar from container rect + TRect containerRect( ContainerRect() ); + + // Now toolbar does not intersect with view, so it must not be taken + // into account when calculating other component layouts. + containerRect.SetRect( TPoint( 0, 0 ), containerRect.Size() ); // Get the rect of stripe. TAknLayoutRect stripeLayoutRect = @@ -682,14 +677,11 @@ TRect listareaRect( listareaLayoutRect.Rect() ); // List panes default rect needs to be modified due to - // possible toolbar, scrollbar and calendar indication stripe + // scrollbar and calendar indication stripe // Remove stripe width from list pane width listareaRect.iTl.iX += iStripeRect.Width(); - // Remove toolbar width from list pane width - listareaRect.iBr.iX -= iToolbar.Rect().Width(); - if( iScrollBar ) { TAknLayoutRect scrollareaLayoutRect = @@ -699,9 +691,6 @@ // Scroll bar's height is always the same as listpane's height scrollareaRect.SetHeight( listareaRect.Height() ); - // Scrollbar needs to be moved to the left side of possible - // toolbar - scrollareaRect.Move( -iToolbar.Rect().Width(), 0 ); iScrollBar->SetRect( scrollareaRect ); // Remove scroll bar width from list area's width @@ -744,8 +733,7 @@ scrollWidth = iScrollBar->Rect().Width(); } - naviArrowRightRect.Move( - -( iToolbar.Rect().Width() + scrollWidth ), 0 ); + naviArrowRightRect.Move( scrollWidth, 0 ); iNaviArrowRight->SetRect( naviArrowRightRect ); } @@ -766,9 +754,7 @@ // The listPane's area should be: // X: Should subtract the width of stripe - // Y: Should subtract the height of MRToolbar listareaRect.iTl.iX += iStripeRect.Width(); - listareaRect.iBr.iY -= iToolbar.Rect().Height(); iListPane->SetRect( listareaRect ); @@ -799,10 +785,6 @@ // stripe width in portrait naviArrowLeftRect.Move( iStripeRect.Width(), 0 ); - // Left arrow needs to be moved up the amount of - // possible toolbar height in portrait - naviArrowLeftRect.Move( 0, -iToolbar.Rect().Height() ); - iNaviArrowLeft->SetRect( naviArrowLeftRect ); } @@ -817,11 +799,6 @@ // stripe width in portrait naviArrowRightRect.Move( iStripeRect.Width(), 0 ); - // Right arrow needs to be moved up the amount of - // possible toolbar height in portrait - naviArrowRightRect.Move( 0, -iToolbar.Rect().Height() ); - - iNaviArrowRight->SetRect( naviArrowRightRect ); } } @@ -996,7 +973,6 @@ case KAknLocalZoomLayoutSwitch: { SizeChanged(); - DrawNow(); break; } default: @@ -1108,16 +1084,6 @@ } // --------------------------------------------------------------------------- -// CESMRView::ReLayout -// --------------------------------------------------------------------------- -// -void CESMRView::ReLayout() - { - FUNC_LOG; - SizeChanged(); - } - -// --------------------------------------------------------------------------- // CESMRView::ProcessEventL // --------------------------------------------------------------------------- // @@ -1161,7 +1127,7 @@ iAttachmentIndicator->SetTextL( value->StringValue() ); iAttachmentIndicator->MakeVisible( ETrue ); - ReLayout(); + SizeChanged(); } } } @@ -1172,7 +1138,7 @@ // TRect CESMRView::CalculateAttachmentIndicatorLayout() { - TRect containerRect( Rect() ); + TRect containerRect( ContainerRect() ); TAknLayoutRect naviArrowLeftLayoutRect = NMRLayoutManager::GetLayoutRect( containerRect, @@ -1194,20 +1160,17 @@ scrollWidth = iScrollBar->Rect().Width(); } - naviArrowRightRect.Move( - -( iToolbar.Rect().Width() + scrollWidth ), 0 ); + naviArrowRightRect.Move( scrollWidth, 0 ); } else { // Left arrow needs to be moved right the amount of // stripe width in portrait naviArrowLeftRect.Move( iStripeRect.Width(), 0 ); - naviArrowLeftRect.Move( 0, -iToolbar.Rect().Height() ); - + TRect naviArrowRightRect = naviArrowRightLayoutRect.Rect(); naviArrowRightRect.Move( iStripeRect.Width(), 0 ); - naviArrowRightRect.Move( 0, -iToolbar.Rect().Height() ); } // Get height for one row @@ -1217,9 +1180,6 @@ TRect rowRect( rowLayout.Rect() ); TRect attachmentIndicatorRect; - /*attachmentIndicatorRect.iTl = - TPoint( naviArrowLeftRect.iBr.iX, - naviArrowLeftRect.iBr.iY - rowRect.Height() ); */ attachmentIndicatorRect.iTl = TPoint( naviArrowLeftRect.iBr.iX, @@ -1232,4 +1192,32 @@ return attachmentIndicatorRect; } +// --------------------------------------------------------------------------- +// CESMRView::ContainerRect +// --------------------------------------------------------------------------- +// +TRect CESMRView::ContainerRect() const + { + // Remove possible intersection with toolbar from container rect + TRect containerRect( PositionRelativeToScreen(), Rect().Size() ); + TRect toolbar( iToolbar.Rect() ); + if ( containerRect.Intersects( toolbar ) ) + { + toolbar.Intersection( containerRect ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + containerRect.SetWidth( containerRect.Width() - toolbar.Width() ); + } + else + { + containerRect.SetHeight( containerRect.Height() - toolbar.Height() ); + } + } + // Now toolbar does not intersect with view, so it must not be taken + // into account when calculating other component layouts. + containerRect.SetRect( TPoint( 0, 0 ), containerRect.Size() ); + + return containerRect; + } + // EOF