1576 const TPoint& pos(aEvent.PointerEvent().iParentPosition); |
1573 const TPoint& pos(aEvent.PointerEvent().iParentPosition); |
1577 if( iTouchPressed ) |
1574 if( iTouchPressed ) |
1578 { |
1575 { |
1579 eventHandled = ETrue; |
1576 eventHandled = ETrue; |
1580 iTouchPressed = EFalse; |
1577 iTouchPressed = EFalse; |
1581 UpdateItemL( iFocusedItem ); |
1578 iVisualizerObserver->TreeVisualizerEventL( |
1582 if( !IsFocusShown() ) |
1579 MFsTreeVisualizerObserver::EFsChangeFocusVisibility ); |
1583 { |
|
1584 MakeSelectorVisibleL( EFalse ); |
|
1585 } |
|
1586 INFO_2( "EButton1Up (%d, %d)", pos.iX, pos.iY ); |
1580 INFO_2( "EButton1Up (%d, %d)", pos.iX, pos.iY ); |
1587 if( !iDragHandler->IsFlicking() ) |
|
1588 { |
|
1589 iPhysics->StopPhysics(); |
|
1590 } |
|
1591 iDragHandler->PointerUp( aEvent.PointerEvent(), id ); |
|
1592 } |
1581 } |
|
1582 if( !iDragHandler->IsFlicking() ) |
|
1583 { |
|
1584 iPhysics->StopPhysics(); |
|
1585 } |
|
1586 iDragHandler->PointerUp( aEvent.PointerEvent(), id ); |
1593 break; |
1587 break; |
1594 } |
1588 } |
1595 case TPointerEvent::EDrag: |
1589 case TPointerEvent::EDrag: |
1596 { |
1590 { |
1597 eventHandled = ETrue; |
1591 eventHandled = ETrue; |
1680 |
1679 |
1681 // --------------------------------------------------------------------------- |
1680 // --------------------------------------------------------------------------- |
1682 // Sets the specified item as focused. |
1681 // Sets the specified item as focused. |
1683 // --------------------------------------------------------------------------- |
1682 // --------------------------------------------------------------------------- |
1684 // |
1683 // |
1685 void CFsTreeVisualizerBase::SetFocusedItemL(const TFsTreeItemId aItemId, |
1684 void CFsTreeVisualizerBase::SetFocusedItemL( const TFsTreeItemId aItemId, |
1686 TBool /*aCheckFocus*/) |
1685 TBool /*aCheckFocus*/ ) |
1687 { |
1686 { |
1688 FUNC_LOG; |
1687 FUNC_LOG; |
1689 MFsTreeItemVisualizer* visualizer = NULL; |
1688 MFsTreeItemVisualizer* visualizer = NULL; |
1690 if (aItemId != iFocusedItem) |
1689 |
1691 { |
1690 if ( aItemId != iFocusedItem ) |
1692 visualizer = iTreeData->ItemVisualizer(iFocusedItem); |
1691 { |
1693 if (visualizer) |
1692 visualizer = iTreeData->ItemVisualizer( iFocusedItem ); |
1694 { |
1693 |
1695 visualizer->UpdateL(iTreeData->ItemData(iFocusedItem), EFalse, |
1694 if ( visualizer ) |
1696 iTreeData->Level(iFocusedItem), iMarkIcon, iMenuIcon, 0); |
1695 { |
1697 } |
1696 visualizer->UpdateL( iTreeData->ItemData( iFocusedItem ), EFalse, |
|
1697 iTreeData->Level( iFocusedItem ), iMarkIcon, iMenuIcon, 0 ); |
|
1698 } |
|
1699 |
1698 iFocusedItem = aItemId; |
1700 iFocusedItem = aItemId; |
1699 } |
1701 } |
1700 visualizer = iTreeData->ItemVisualizer(iFocusedItem); |
1702 |
1701 if (visualizer) |
1703 visualizer = iTreeData->ItemVisualizer( iFocusedItem ); |
|
1704 |
|
1705 if ( visualizer ) |
1702 { |
1706 { |
1703 TBool focused = IsFocusShown(); |
1707 TBool focused = IsFocusShown(); |
1704 visualizer->UpdateL(iTreeData->ItemData(iFocusedItem), focused, |
1708 visualizer->UpdateL( iTreeData->ItemData( iFocusedItem ), focused, |
1705 iTreeData->Level(iFocusedItem), iMarkIcon, iMenuIcon, 0); |
1709 iTreeData->Level( iFocusedItem ), iMarkIcon, iMenuIcon, 0 ); |
1706 } |
1710 } |
1707 if (iFocusedItem != KFsTreeNoneID) |
1711 |
|
1712 if ( iFocusedItem != KFsTreeNoneID ) |
1708 { |
1713 { |
1709 UpdateSelectorVisualL(); |
1714 UpdateSelectorVisualL(); |
1710 if (!iViewPort.ItemFullyVisible(iFocusedItem)) |
1715 |
1711 { |
1716 if ( !iViewPort.ItemFullyVisible( iFocusedItem ) ) |
1712 iViewPort.ScrollItemToViewL(iFocusedItem); |
1717 { |
|
1718 iViewPort.ScrollItemToViewL( iFocusedItem ); |
1713 } |
1719 } |
1714 } |
1720 } |
1715 } |
1721 } |
1716 |
1722 |
1717 // --------------------------------------------------------------------------- |
1723 // --------------------------------------------------------------------------- |
2556 {//there is only background brush attached to this layout |
2562 {//there is only background brush attached to this layout |
2557 iWatermarkLayout->Brushes()->Remove(KZero); |
2563 iWatermarkLayout->Brushes()->Remove(KZero); |
2558 iWatermarkLayout->Brushes()->Reset(); |
2564 iWatermarkLayout->Brushes()->Reset(); |
2559 iWatermarkLayout->SetFlag(EAlfVisualChanged); |
2565 iWatermarkLayout->SetFlag(EAlfVisualChanged); |
2560 } |
2566 } |
2561 } |
|
2562 |
2567 |
2563 CAlfGradientBrush* backgroundBrush = CAlfGradientBrush::NewL( |
2568 CAlfGradientBrush* backgroundBrush = CAlfGradientBrush::NewL( |
2564 iOwnerControl->Env()); |
2569 iOwnerControl->Env()); |
2565 backgroundBrush->SetLayer(EAlfBrushLayerBackground); |
2570 backgroundBrush->SetLayer(EAlfBrushLayerBackground); |
2566 backgroundBrush->SetColor(aColor); |
2571 backgroundBrush->SetColor(aColor); |
2567 |
2572 |
2568 iWatermarkLayout->Brushes()->AppendL(backgroundBrush, EAlfHasOwnership); |
2573 iWatermarkLayout->Brushes()->AppendL(backgroundBrush, EAlfHasOwnership); |
|
2574 } |
2569 } |
2575 } |
2570 |
2576 |
2571 // --------------------------------------------------------------------------- |
2577 // --------------------------------------------------------------------------- |
2572 // Sets a given brush as a list background. |
2578 // Sets a given brush as a list background. |
2573 // --------------------------------------------------------------------------- |
2579 // --------------------------------------------------------------------------- |
3640 const TInt pageSize(iViewPort.Size().iHeight); |
3647 const TInt pageSize(iViewPort.Size().iHeight); |
3641 iScrollbarModel.SetScrollSpan(Max(iWorld.Height(), pageSize)); |
3648 iScrollbarModel.SetScrollSpan(Max(iWorld.Height(), pageSize)); |
3642 iScrollbarModel.SetWindowSize(pageSize); |
3649 iScrollbarModel.SetWindowSize(pageSize); |
3643 iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); |
3650 iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); |
3644 iScrollBar->SetModelL(&iScrollbarModel); |
3651 iScrollBar->SetModelL(&iScrollbarModel); |
|
3652 iScrollBar->DrawNow(); |
3645 |
3653 |
3646 RArray<TInt> columns; |
3654 RArray<TInt> columns; |
3647 CleanupClosePushL(columns); |
3655 CleanupClosePushL(columns); |
3648 TBool updateLayouts(EFalse); |
3656 TBool updateLayouts(EFalse); |
3649 if (iViewPort.IsScrollBarNeeded() && iVisualizationState |
3657 if (iViewPort.IsScrollBarNeeded() && iVisualizationState |
3650 == EFsTreeVisible) |
3658 == EFsTreeVisible) |
3651 { |
3659 { |
3652 iScrollBar->SetRect(scrollPane); |
3660 iScrollBar->SetRect(scrollPane); |
3653 columns.AppendL(listPane.Width()); |
3661 if (AknLayoutUtils::LayoutMirrored()) |
3654 columns.AppendL(scrollPane.Width()); |
3662 { |
|
3663 columns.AppendL(scrollPane.Width()); |
|
3664 columns.AppendL(listPane.Width()); |
|
3665 } |
|
3666 else |
|
3667 { |
|
3668 columns.AppendL(listPane.Width()); |
|
3669 columns.AppendL(scrollPane.Width()); |
|
3670 } |
3655 iComponentLayout->SetColumnsL(columns); |
3671 iComponentLayout->SetColumnsL(columns); |
3656 iScrollBar->MakeVisible(ETrue); |
3672 iScrollBar->MakeVisible(ETrue); |
3657 updateLayouts = ETrue; |
3673 updateLayouts = ETrue; |
3658 } |
3674 } |
3659 else if (!iViewPort.IsScrollBarNeeded()) |
3675 else if (!iViewPort.IsScrollBarNeeded()) |
3660 { |
3676 { |
3661 columns.AppendL(listPane.Width()); |
3677 if (AknLayoutUtils::LayoutMirrored()) |
|
3678 { |
|
3679 columns.AppendL(0); |
|
3680 columns.AppendL(listPane.Width()); |
|
3681 } |
|
3682 else |
|
3683 { |
|
3684 columns.AppendL(listPane.Width()); |
|
3685 columns.AppendL(0); |
|
3686 } |
3662 iComponentLayout->SetColumnsL(columns); |
3687 iComponentLayout->SetColumnsL(columns); |
3663 iScrollBar->MakeVisible(EFalse); |
3688 iScrollBar->MakeVisible(EFalse); |
3664 updateLayouts = ETrue; |
3689 updateLayouts = ETrue; |
3665 } |
3690 } |
3666 CleanupStack::PopAndDestroy(); // columns.Close() |
3691 CleanupStack::PopAndDestroy(); // columns.Close() |
3920 // --------------------------------------------------------------------------- |
3945 // --------------------------------------------------------------------------- |
3921 // |
3946 // |
3922 void CFsTreeVisualizerBase::UpdateSelectorVisualL(TInt /*aTime*/) |
3947 void CFsTreeVisualizerBase::UpdateSelectorVisualL(TInt /*aTime*/) |
3923 { |
3948 { |
3924 FUNC_LOG; |
3949 FUNC_LOG; |
3925 if (iSelectorVisual) |
3950 |
3926 { |
3951 if ( iSelectorVisual ) |
3927 if (iFocusedItem == KFsTreeNoneID || !iFlags.IsSet(EListFocused) || !IsFocusShown()) |
3952 { |
|
3953 if ( iFocusedItem == KFsTreeNoneID || |
|
3954 !iFlags.IsSet( EListFocused ) || !IsFocusShown() ) |
3928 { |
3955 { |
3929 TAlfTimedValue opacity; |
3956 TAlfTimedValue opacity; |
3930 opacity.SetValueNow(0.0f); |
3957 opacity.SetValueNow( 0.0f ); |
3931 iSelectorVisual->SetOpacity(opacity); |
3958 iSelectorVisual->SetOpacity( opacity ); |
3932 } |
3959 } |
3933 else |
3960 else |
3934 { |
3961 { |
3935 //check if item is visible |
3962 //check if item is visible |
3936 MFsTreeItemVisualizer* vis(NULL); |
3963 MFsTreeItemVisualizer* vis( NULL ); |
3937 |
3964 |
3938 iListLayout->SetFlag(EAlfVisualFlagFreezeLayout); |
3965 iListLayout->SetFlag( EAlfVisualFlagFreezeLayout ); |
3939 iListItemBackgroundLayout->SetFlag(EAlfVisualFlagFreezeLayout); |
3966 iListItemBackgroundLayout->SetFlag( EAlfVisualFlagFreezeLayout ); |
3940 |
3967 |
3941 TRect itemRect(iViewPort.ItemRect(iFocusedItem)); |
3968 TRect itemRect( iViewPort.ItemRect( iFocusedItem ) ); |
3942 if (itemRect.Height()) |
3969 |
|
3970 if ( itemRect.Height() ) |
3943 { |
3971 { |
3944 TSize currSize; |
3972 TSize currSize; |
3945 currSize.iWidth = iListLayout->Size().iX.Target() - 2 |
3973 currSize.iWidth = iListLayout->Size().iX.Target() - 2 |
3946 * iListLayout->PaddingInPixels().iTl.iX; |
3974 * iListLayout->PaddingInPixels().iTl.iX; |
3947 currSize.iHeight = itemRect.Height(); |
3975 currSize.iHeight = itemRect.Height(); |
3948 iSelectorVisual->SetSize(currSize, 0); |
3976 iSelectorVisual->SetSize( currSize, 0 ); |
3949 TAlfRealPoint pNow; |
3977 TAlfRealPoint pNow; |
3950 pNow.iY = itemRect.iTl.iY; |
3978 pNow.iY = itemRect.iTl.iY; |
3951 pNow.iX = iListLayout->PaddingInPixels().iTl.iX; |
3979 pNow.iX = iListLayout->PaddingInPixels().iTl.iX; |
3952 iSelectorVisual->SetPos(pNow, 0); |
3980 iSelectorVisual->SetPos( pNow, 0 ); |
3953 |
3981 |
3954 TAlfTimedValue opacity(iSelectorOpacity, 0); |
3982 TAlfTimedValue opacity( iSelectorOpacity, 0 ); |
3955 iSelectorVisual->SetOpacity(opacity); |
3983 iSelectorVisual->SetOpacity( opacity ); |
3956 if (iMarqueeType != EFsTextMarqueeNone) |
3984 iFocusVisible = ETrue; |
|
3985 |
|
3986 if ( iMarqueeType != EFsTextMarqueeNone ) |
3957 { |
3987 { |
3958 vis = iTreeData->ItemVisualizer(iFocusedItem); |
3988 vis = iTreeData->ItemVisualizer( iFocusedItem ); |
3959 vis->MarqueeL(iMarqueeType, iMarqueeSpeed, |
3989 vis->MarqueeL( iMarqueeType, iMarqueeSpeed, |
3960 iMarqueStartDelay, iMarqueCycleStartDelay, |
3990 iMarqueStartDelay, iMarqueCycleStartDelay, |
3961 iMarqueeRepetitions); |
3991 iMarqueeRepetitions ); |
3962 } |
3992 } |
3963 } |
3993 } |
3964 else |
3994 else |
3965 { |
3995 { |
3966 TAlfTimedValue opacity; |
3996 TAlfTimedValue opacity; |
3967 opacity.SetValueNow(0.0f); |
3997 opacity.SetValueNow( 0.0f ); |
3968 iSelectorVisual->SetOpacity(opacity); |
3998 iSelectorVisual->SetOpacity( opacity ); |
3969 } |
3999 } |
3970 |
4000 |
3971 iListLayout->ClearFlag(EAlfVisualFlagFreezeLayout); |
4001 iListLayout->ClearFlag( EAlfVisualFlagFreezeLayout ); |
3972 iListItemBackgroundLayout->ClearFlag(EAlfVisualFlagFreezeLayout); |
4002 iListItemBackgroundLayout->ClearFlag( EAlfVisualFlagFreezeLayout ); |
3973 } |
4003 } |
3974 } |
4004 } |
3975 else if (iFocusedItem != KFsTreeNoneID && iFlags.IsSet(EListFocused)) |
4005 else if ( iFocusedItem != KFsTreeNoneID && iFlags.IsSet( EListFocused ) ) |
3976 { |
4006 { |
3977 MakeSelectorVisibleL(ETrue); |
4007 MakeSelectorVisibleL( ETrue ); |
3978 } |
4008 } |
3979 } |
4009 } |
3980 |
4010 |
3981 // --------------------------------------------------------------------------- |
4011 // --------------------------------------------------------------------------- |
3982 // The function deletes selector visual. |
4012 // The function deletes selector visual. |
4620 iWatermarkLayout); |
4650 iWatermarkLayout); |
4621 iComponentLayout->SetClipping(ETrue); |
4651 iComponentLayout->SetClipping(ETrue); |
4622 iComponentLayout->EnableBrushesL(); |
4652 iComponentLayout->EnableBrushesL(); |
4623 iComponentLayout->UpdateChildrenLayout(); |
4653 iComponentLayout->UpdateChildrenLayout(); |
4624 |
4654 |
4625 iListDeck = CAlfDeckLayout::AddNewL(*iOwnerControl, iComponentLayout); |
4655 if (AknLayoutUtils::LayoutMirrored()) |
4626 |
4656 { |
|
4657 iDummyScrollbar = CAlfImageVisual::AddNewL(*iOwnerControl); |
|
4658 iComponentLayout->Append(iDummyScrollbar); |
|
4659 iListDeck = CAlfDeckLayout::AddNewL(*iOwnerControl, iComponentLayout); |
|
4660 } |
|
4661 else |
|
4662 { |
|
4663 iListDeck = CAlfDeckLayout::AddNewL(*iOwnerControl, iComponentLayout); |
|
4664 iDummyScrollbar = CAlfImageVisual::AddNewL(*iOwnerControl); |
|
4665 iComponentLayout->Append(iDummyScrollbar); |
|
4666 } |
4627 iListItemBackgroundLayout = CAlfFlowLayout::AddNewL(*iOwnerControl, |
4667 iListItemBackgroundLayout = CAlfFlowLayout::AddNewL(*iOwnerControl, |
4628 iListDeck); |
4668 iListDeck); |
4629 iListItemBackgroundLayout->SetFlowDirection(CAlfFlowLayout::EFlowVertical); |
4669 iListItemBackgroundLayout->SetFlowDirection(CAlfFlowLayout::EFlowVertical); |
4630 iListItemBackgroundLayout->SetClipping(ETrue); |
4670 iListItemBackgroundLayout->SetClipping(ETrue); |
4631 iListItemBackgroundLayout->EnableScrollingL(ETrue); |
4671 iListItemBackgroundLayout->EnableScrollingL(ETrue); |
4664 iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); |
4704 iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); |
4665 iScrollbarModel.SetWindowSize(iListLayout->Size().iY.Target()); |
4705 iScrollbarModel.SetWindowSize(iListLayout->Size().iY.Target()); |
4666 |
4706 |
4667 iScrollBar->MakeVisible(EFalse); |
4707 iScrollBar->MakeVisible(EFalse); |
4668 iScrollBar->SetModelL(&iScrollbarModel); |
4708 iScrollBar->SetModelL(&iScrollbarModel); |
4669 |
|
4670 iDummyScrollbar = CAlfImageVisual::AddNewL(*iOwnerControl); |
|
4671 iComponentLayout->Append(iDummyScrollbar); |
|
4672 |
4709 |
4673 // </cmail> |
4710 // </cmail> |
4674 |
4711 |
4675 iFadeEffect = CFsFadeEffect::NewL(iOwnerControl, this, iRootLayout, 0); |
4712 iFadeEffect = CFsFadeEffect::NewL(iOwnerControl, this, iRootLayout, 0); |
4676 iSlideEffect = CFsSlideEffect::NewL(iOwnerControl, this, iRootLayout, 0); |
4713 iSlideEffect = CFsSlideEffect::NewL(iOwnerControl, this, iRootLayout, 0); |