212 // Do not call StartLayoutSwitchFullScreen(), |
212 // Do not call StartLayoutSwitchFullScreen(), |
213 // layout switch effect is started automatically |
213 // layout switch effect is started automatically |
214 iIsKastorEffectStarted = ETrue; |
214 iIsKastorEffectStarted = ETrue; |
215 TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; |
215 TInt lastItemIndex = iCurrentContainer->NumberOfItems() - 1; |
216 |
216 |
217 TBool makeLastItemVisible = lastItemIndex >= 0 && |
217 if ( lastItemIndex >= 0 && iCurrentContainer->ItemIsFullyVisible( lastItemIndex ) && |
218 iCurrentContainer->ItemIsFullyVisible( lastItemIndex ); |
218 !iCurrentContainer->IsHighlightVisible() ) |
219 |
219 { |
|
220 iCurrentContainer->SetManualHighlightL( lastItemIndex, EFalse ); |
|
221 } |
|
222 |
220 iCurrentContainer->SetRect( ClientRect() ); |
223 iCurrentContainer->SetRect( ClientRect() ); |
221 iDummyContainer->SetRect( ClientRect() ); |
224 iDummyContainer->SetRect( ClientRect() ); |
222 |
|
223 // This fixes a problem (view scrolled one row up) that occurs when |
|
224 // switching from portrait to landscape orientation with scrollbar |
|
225 // in bottom position. |
|
226 if ( makeLastItemVisible ) |
|
227 { |
|
228 iCurrentContainer->Widget()->View()->SetTopItemIndex( |
|
229 iCurrentContainer->Widget()->View()-> |
|
230 CalcNewTopItemIndexSoItemIsVisible( lastItemIndex ) ); |
|
231 } |
|
232 |
225 |
233 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
226 THashMapIter< TInt, CMmWidgetContainer* > iterator( iContainerMap ); |
234 while( iterator.NextKey() ) |
227 while( iterator.NextKey() ) |
235 { |
228 { |
236 CMmWidgetContainer* container = *iterator.CurrentValue(); |
229 CMmWidgetContainer* container = *iterator.CurrentValue(); |
1525 //store items, position as the key |
1518 //store items, position as the key |
1526 menuItemMap.InsertL( ( i + 1 ) * KMenuPosMultiplier, |
1519 menuItemMap.InsertL( ( i + 1 ) * KMenuPosMultiplier, |
1527 aMenuPane-> |
1520 aMenuPane-> |
1528 ItemData( aMenuPane->MenuItemCommandId( i ) ) ); |
1521 ItemData( aMenuPane->MenuItemCommandId( i ) ) ); |
1529 } |
1522 } |
|
1523 |
|
1524 TInt itemSpecificMenuItemsCount = 0; |
1530 |
1525 |
1531 //get custom menu items and their positions |
1526 //get custom menu items and their positions |
1532 while ( menuIterator->HasNext() ) |
1527 while ( menuIterator->HasNext() ) |
1533 { |
1528 { |
1534 CHnMenuItemModel* menuItem = menuIterator->GetNext(); |
1529 CHnMenuItemModel* menuItem = menuIterator->GetNext(); |
1535 if ( !menuItem->IsItemSpecific() || !ignoreItemSpecific ) |
1530 TBool isItemSpecific = menuItem->IsItemSpecific(); |
|
1531 if ( isItemSpecific ) |
|
1532 { |
|
1533 ++itemSpecificMenuItemsCount; |
|
1534 } |
|
1535 if ( !isItemSpecific || !ignoreItemSpecific ) |
1536 { |
1536 { |
1537 CEikMenuPaneItem::SData menuData; |
1537 CEikMenuPaneItem::SData menuData; |
1538 menuData.iCommandId = menuItem->Command(); |
1538 menuData.iCommandId = menuItem->Command(); |
1539 menuData.iText = menuItem->NameL(). |
1539 menuData.iText = menuItem->NameL(). |
1540 Left( CEikMenuPaneItem::SData::ENominalTextLength ); |
1540 Left( CEikMenuPaneItem::SData::ENominalTextLength ); |
1568 } |
1568 } |
1569 positionArray.AppendL( menuItem->Position() ); |
1569 positionArray.AppendL( menuItem->Position() ); |
1570 menuItemMap.InsertL( menuItem->Position(), menuData ); |
1570 menuItemMap.InsertL( menuItem->Position(), menuData ); |
1571 } |
1571 } |
1572 } |
1572 } |
|
1573 |
|
1574 // DynInitMenuPaneL always gets called immediately after an item is touched and |
|
1575 // because of that it is possible to enable/disable settings that affect long |
|
1576 // tap behavior here. |
|
1577 iCurrentContainer->EnableLongTapAnimation( itemSpecificMenuItemsCount > 0 ); |
1573 |
1578 |
1574 aMenuPane->Reset(); |
1579 aMenuPane->Reset(); |
1575 positionArray.Sort(); |
1580 positionArray.Sort(); |
1576 |
1581 |
1577 //add items in correct order |
1582 //add items in correct order |