equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
1157 LayoutView(); |
1157 LayoutView(); |
1158 |
1158 |
1159 // Update scrollbars. |
1159 // Update scrollbars. |
1160 UpdateScrollbars(); |
1160 UpdateScrollbars(); |
1161 |
1161 |
1162 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
1163 UpdateIndexes(); |
1162 UpdateIndexes(); |
1164 #endif |
|
1165 AknsUtils::RegisterControlPosition( this, PositionRelativeToScreen() ); |
1163 AknsUtils::RegisterControlPosition( this, PositionRelativeToScreen() ); |
1166 |
1164 |
1167 TRAP_IGNORE( InitPhysicsL() ); |
1165 TRAP_IGNORE( InitPhysicsL() ); |
1168 } |
1166 } |
1169 |
1167 |
1491 void CAknTreeListView::UpdateVisibleItems( TInt aIndex, CAknTreeItem* aItem ) |
1489 void CAknTreeListView::UpdateVisibleItems( TInt aIndex, CAknTreeItem* aItem ) |
1492 { |
1490 { |
1493 SetFocusIndex( KMinTInt ); |
1491 SetFocusIndex( KMinTInt ); |
1494 if ( !iItems.Count() ) |
1492 if ( !iItems.Count() ) |
1495 { |
1493 { |
1496 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
1497 UpdateIndexes(); |
1494 UpdateIndexes(); |
1498 #endif |
|
1499 return; |
1495 return; |
1500 } |
1496 } |
1501 |
1497 |
1502 TInt index = Min( aIndex, iTree.VisibleItemIndex( aItem ) ); |
1498 TInt index = Min( aIndex, iTree.VisibleItemIndex( aItem ) ); |
1503 |
1499 |
1531 if ( iItems[ii].Item() == FocusedItem() ) |
1527 if ( iItems[ii].Item() == FocusedItem() ) |
1532 { |
1528 { |
1533 SetFocusIndex( ii ); |
1529 SetFocusIndex( ii ); |
1534 } |
1530 } |
1535 } |
1531 } |
1536 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
1537 UpdateIndexes(); |
1532 UpdateIndexes(); |
1538 #endif |
|
1539 } |
1533 } |
1540 |
1534 |
1541 |
1535 |
1542 // --------------------------------------------------------------------------- |
1536 // --------------------------------------------------------------------------- |
1543 // Updates the view items so that the focused item remains in the same |
1537 // Updates the view items so that the focused item remains in the same |
1579 SetFocusIndex( ii ); |
1573 SetFocusIndex( ii ); |
1580 } |
1574 } |
1581 item = iterator.Next(); |
1575 item = iterator.Next(); |
1582 } |
1576 } |
1583 } |
1577 } |
1584 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
1585 UpdateIndexes(); |
1578 UpdateIndexes(); |
1586 #endif |
|
1587 } |
1579 } |
1588 else if ( itemCount && iItems.Count() ) |
1580 else if ( itemCount && iItems.Count() ) |
1589 { |
1581 { |
1590 if ( FocusedItemVisible() ) |
1582 if ( FocusedItemVisible() ) |
1591 { |
1583 { |
2776 } |
2768 } |
2777 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2769 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2778 |
2770 |
2779 // text color, used to draw the separator line between list items |
2771 // text color, used to draw the separator line between list items |
2780 TRgb textColor( KRgbBlack ); |
2772 TRgb textColor( KRgbBlack ); |
2781 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, |
2773 AknsUtils::GetCachedColor( skin, |
2782 KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); |
2774 textColor, |
|
2775 KAknsIIDQsnTextColors, |
|
2776 EAknsCIQsnTextColorsCG6 ); |
2783 |
2777 |
2784 const TInt itemCount = iItems.Count(); |
2778 const TInt itemCount = iItems.Count(); |
2785 for ( TInt ii = 0; ii < itemCount; ++ii ) |
2779 for ( TInt ii = 0; ii < itemCount; ++ii ) |
2786 { |
2780 { |
2787 TRect drawRect( iItems[ii].Rect() ); |
2781 TRect drawRect( iItems[ii].Rect() ); |
2821 transApi->StopDrawing(); |
2815 transApi->StopDrawing(); |
2822 } |
2816 } |
2823 #endif |
2817 #endif |
2824 if ( ii < iBottomIndex ) |
2818 if ( ii < iBottomIndex ) |
2825 { |
2819 { |
2826 AknListUtils::DrawSeparator( gc, tfxDrawRect, textColor ); |
2820 AknListUtils::DrawSeparator( gc, drawRect, textColor, skin ); |
2827 } |
2821 } |
2828 |
2822 |
2829 TBool focused = ( IsFocused() && FocusedItem() && |
2823 TBool focused = ( IsFocused() && FocusedItem() && |
2830 iItems[ii].Item() == FocusedItem() ); |
2824 iItems[ii].Item() == FocusedItem() ); |
2831 |
2825 |
3166 |
3160 |
3167 TInt& CAknTreeListView::BottomIndex() |
3161 TInt& CAknTreeListView::BottomIndex() |
3168 { |
3162 { |
3169 return iBottomIndex; |
3163 return iBottomIndex; |
3170 } |
3164 } |
3171 |
3165 |
|
3166 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
|
3167 // --------------------------------------------------------------------------- |
|
3168 // CAknTreeListView::UpdateIndexes |
|
3169 // --------------------------------------------------------------------------- |
|
3170 // |
3172 void CAknTreeListView::UpdateIndexes() |
3171 void CAknTreeListView::UpdateIndexes() |
3173 { |
3172 { |
|
3173 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
3174 iTopIndex = iBottomIndex = iHighlightIndex = 0; |
3174 iTopIndex = iBottomIndex = iHighlightIndex = 0; |
|
3175 #else |
|
3176 iBottomIndex = 0; |
|
3177 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
3175 |
3178 |
3176 if ( iItems.Count() ) |
3179 if ( iItems.Count() ) |
3177 { |
3180 { |
3178 for (TInt i=iItems.Count()-1; i>=0; i--) |
3181 for (TInt i=iItems.Count()-1; i>=0; i--) |
3179 { |
3182 { |
3182 iBottomIndex = iTree.VisibleItemIndex(iItems[i].Item()); |
3185 iBottomIndex = iTree.VisibleItemIndex(iItems[i].Item()); |
3183 break; |
3186 break; |
3184 } |
3187 } |
3185 } |
3188 } |
3186 |
3189 |
|
3190 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
3187 iTopIndex = iTree.VisibleItemIndex(iItems[0].Item()); |
3191 iTopIndex = iTree.VisibleItemIndex(iItems[0].Item()); |
3188 iHighlightIndex = iTree.VisibleItemIndex(FocusedItem()); |
3192 iHighlightIndex = iTree.VisibleItemIndex(FocusedItem()); |
|
3193 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
3189 } |
3194 } |
3190 } |
3195 } |
3191 |
3196 |
3192 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
|