--- a/uifw/AvKon/src/akntabgrp.cpp Wed Sep 15 12:29:17 2010 +0300
+++ b/uifw/AvKon/src/akntabgrp.cpp Wed Oct 13 14:50:15 2010 +0300
@@ -38,7 +38,6 @@
#include <AknTasHook.h>
#include <touchfeedback.h>
-#include <AknPriv.hrh>
// USER INCLUDE FILES
#include "aknappui.h"
@@ -105,9 +104,6 @@
/** Indicates whether or not the tab is shown in long tab group layout. */
TBool iLongTab;
-
- /** Indicates the hilight status of the tab*/
- TBool iHighlight;
};
CAknTabExtension* CAknTabExtension::NewL()
@@ -299,8 +295,6 @@
if ( !iExtension )
{
iExtension = CAknTabExtension::NewL();
- //set the default highlight status of the tab
- iExtension->iHighlight = EFalse;
}
iLabel = new (ELeave) CEikLabel;
@@ -813,14 +807,7 @@
}
-// ---------------------------------------------------------------------------
-// sets the highlight status of a tab
-// ---------------------------------------------------------------------------
-//
-void CAknTab::SetHighlight(TBool aHighlight)
- {
- iExtension->iHighlight = aHighlight;
- }
+
// ---------------------------------------------------------------------------
// Handles size change events in flat status pane layouts.
// ---------------------------------------------------------------------------
@@ -1046,7 +1033,7 @@
}
else
{
- if (iActive || iExtension->iHighlight)
+ if ( iActive )
{
TInt error = AknsUtils::GetCachedColor( skin, color,
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG3 );
@@ -1084,7 +1071,7 @@
iColorBitmaps->At(KTabColorBitmapActiveColorIndex) &&
iColorBitmaps->At(KTabColorBitmapPassiveColorIndex) )
{
- if (iActive || iExtension->iHighlight)
+ if( iActive )
{
colorBitmap = iColorBitmaps->At(KTabColorBitmapActiveColorIndex);
}
@@ -1275,8 +1262,8 @@
if ( !iColorBitmaps )
{
- TRAP_IGNORE(LoadColorBitmapL());
- }
+ LoadColorBitmapL();
+ }
}
void CAknTab::SetNarrowTabLayout( TBool aNarrow )
@@ -1412,9 +1399,6 @@
/** This is the tab width that is set by the application. */
TInt iRequestedTabWidth;
-
- /** Indicates whether highlight tab is being drawn or not*/
- TBool iHighlight;
};
@@ -1422,8 +1406,6 @@
{
iPointerDownTab = -1;
iPointerDownXPosition = -1;
- //Highlight is disabled by default.
- iHighlight = EFalse;
}
@@ -1889,7 +1871,7 @@
{
iExtension->iTabBackgroundLayout.iUse = EFalse;
- iExtension->iTabSvgGraphics->DrawTabGroupBackground(
+ iExtension->iTabSvgGraphics->DrawTabGroupBackgroundL(
CAknTabGroupGraphics::ENoDraw,
iLongTabs,
iNumberOfTabsShown,
@@ -2635,13 +2617,11 @@
if (iExtension->iNarrowTabLayout)
{
- iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackground(
- CAknTabGroupGraphics::ENormal,
- iLongTabs,
- iNumberOfTabsShown,
- positionActive + 1,
- &gc,
- iExtension->iTabBackgroundLayout);
+ iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackgroundL(
+ CAknTabGroupGraphics::ENormal, iLongTabs,
+ iNumberOfTabsShown, positionActive + 1, &gc,
+ iExtension->iTabBackgroundLayout);
+
}
else
{
@@ -2651,36 +2631,18 @@
if ( animationOngoing )
{
- animation = iExtension->iTabCycleAnimationDirection == ELeft ?
- CAknTabGroupGraphics::ECycleToLeft : CAknTabGroupGraphics::ECycleToRight;
+ animation
+ = iExtension->iTabCycleAnimationDirection == ELeft
+ ? CAknTabGroupGraphics::ECycleToLeft
+ : CAknTabGroupGraphics::ECycleToRight;
}
-
- if (!iExtension->iHighlight)
- {
- // if highlight is not active
- iExtension->iTabSvgGraphics->DrawTabGroupBackground(
- CAknTabGroupGraphics::ENormal,
- iLongTabs,
- iNumberOfTabsShown,
- positionActive + 1,
- &gc,
- animationOngoing ? iExtension->iNextTabBackgroundLayout : iExtension->iTabBackgroundLayout,
- iExtension->iTabsHidden,
- animation);
- }
- else
- {
- // Highlight is active
- TInt highlightTab = iExtension->iPointerDownTab - iFirstShownTab + 1; //pointer down tab index w.r.t shown tabs
- iExtension->iTabSvgGraphics->DrawTabGroupBackground(
- CAknTabGroupGraphics::ENormal,
- iLongTabs,
- iNumberOfTabsShown,
- positionActive + 1,
- &gc,
- animationOngoing ? iExtension->iNextTabBackgroundLayout : iExtension->iTabBackgroundLayout,
- iExtension->iTabsHidden, animation, highlightTab );
- }
+ iExtension->iTabSvgGraphics->DrawTabGroupBackgroundL(
+ CAknTabGroupGraphics::ENormal, iLongTabs,
+ iNumberOfTabsShown, positionActive + 1, &gc,
+ animationOngoing ? iExtension->iNextTabBackgroundLayout
+ : iExtension->iTabBackgroundLayout,
+ iExtension->iTabsHidden, animation);
+
}
}
else
@@ -2917,10 +2879,8 @@
// pointer position.
newTab = iActiveTab;
}
-
- //Activates highlight drawing for pressed tab.
- EnableHighlight( ETrue, newTab, aPointerEvent.iPosition.iX );
-
+ iExtension->iPointerDownTab = newTab;
+ iExtension->iPointerDownXPosition = aPointerEvent.iPosition.iX;
return;
}
else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
@@ -2950,8 +2910,9 @@
// if the button up event occurs ouside tabgroup, ignore it.
if ( !Rect().Contains( aPointerEvent.iPosition ) || iExtension->iPointerDownTab != newTab )
{
- EnableHighlight( EFalse );
- return;
+ iExtension->iPointerDownTab = -1;
+ iExtension->iPointerDownXPosition = -1;
+ return ;
}
if ( newTab != iActiveTab &&
@@ -3057,7 +3018,8 @@
}
}
- EnableHighlight( EFalse );
+ iExtension->iPointerDownTab = -1;
+ iExtension->iPointerDownXPosition = -1;
}
}
}
@@ -3411,12 +3373,6 @@
TRAP_IGNORE( InitTabGroupGraphicsL() );
TRAP_IGNORE( LoadTabBitmapsL( iNumberOfTabsShown, iLongTabs ) );
}
-
- // Stop highlighting the pressed tab when receives KAknMessageFocusLost event.
- if( aType == KAknMessageFocusLost )
- {
- EnableHighlight(EFalse);
- }
if ( aType == KEikDynamicLayoutVariantSwitch )
{
@@ -3432,14 +3388,14 @@
ParentRect( iExtension->iNaviArrowsUsed ) );
iExtension->iTabBackgroundLayout.iUse = EFalse;
- iExtension->iTabSvgGraphics->DrawTabGroupBackground(
+ TRAP_IGNORE( iExtension->iTabSvgGraphics->DrawTabGroupBackgroundL(
CAknTabGroupGraphics::ENoDraw,
iLongTabs,
iNumberOfTabsShown,
1,
NULL,
iExtension->iTabBackgroundLayout,
- CAknTabGroupGraphics::ENone );
+ CAknTabGroupGraphics::ENone ) );
iExtension->iTabBackgroundLayout.iUse = ETrue;
SetDecoratorLayout( EFalse );
}
@@ -3447,7 +3403,6 @@
if ( iExtension )
{
iExtension->iNarrowTabLayout = EFalse;
- EnableHighlight(EFalse);
}
if ( !COMPARE_BOOLS( iMirrored, AknLayoutUtils::LayoutMirrored() ) )
@@ -4088,7 +4043,7 @@
if ( aNarrow )
{
iExtension->iNextTabBackgroundLayout.iUse = EFalse;
- iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackground(
+ iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackgroundL(
CAknTabGroupGraphics::ENoDraw,
iLongTabs,
iNumberOfTabsShown,
@@ -4100,7 +4055,7 @@
if ( !aUseAnimation )
{
iExtension->iTabBackgroundLayout.iUse = EFalse;
- iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackground(
+ iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackgroundL(
CAknTabGroupGraphics::ENoDraw,
iLongTabs,
iNumberOfTabsShown,
@@ -4113,7 +4068,7 @@
else
{
iExtension->iNextTabBackgroundLayout.iUse = EFalse;
- iExtension->iTabSvgGraphics->DrawTabGroupBackground(
+ iExtension->iTabSvgGraphics->DrawTabGroupBackgroundL(
CAknTabGroupGraphics::ENoDraw,
iLongTabs,
iNumberOfTabsShown,
@@ -4124,7 +4079,7 @@
iExtension->iNextTabBackgroundLayout.iUse = ETrue;
iExtension->iTabBackgroundLayout.iUse = EFalse;
- iExtension->iTabSvgGraphics->DrawTabGroupBackground(
+ iExtension->iTabSvgGraphics->DrawTabGroupBackgroundL(
CAknTabGroupGraphics::ENoDraw,
iLongTabs,
iNumberOfTabsShown,
@@ -4489,42 +4444,4 @@
CancelTabAnimationEventTimer();
}
-void CAknTabGroup::ResetHighlightStatus()
- {
- // Resets highlight status to EFalse
- for( TInt i = 0; i < iTabArray->Count(); i++ )
- {
- iTabArray->At(i)->SetHighlight( EFalse );
- }
- }
-
-void CAknTabGroup::EnableHighlight( TBool aEnable, TInt aNewTab , TInt aPointX )
- {
- iExtension->iPointerDownTab = aNewTab;
- iExtension->iPointerDownXPosition = aPointX;
- if( aEnable )
- {
- //Activates highlight drawing for pressed tab.
- if (!iExtension->iHighlight)
- {
- iExtension->iHighlight = ETrue;
-
- // Set the pressed tab to highlight
- if ( iExtension->iPointerDownTab >= 0 )
- {
- iTabArray->At( iExtension->iPointerDownTab )->SetHighlight( ETrue );
- }
- DrawDeferred();
- }
- }
- else
- {
- if (iExtension->iHighlight)
- {
- iExtension->iHighlight = EFalse;
- ResetHighlightStatus();
- DrawDeferred();
- }
- }
- }
// End of File