55 #include "akntitle.h" |
55 #include "akntitle.h" |
56 #include "AknTitlePaneLabel.h" |
56 #include "AknTitlePaneLabel.h" |
57 #include "AknDebug.h" |
57 #include "AknDebug.h" |
58 |
58 |
59 const TInt KAknNaviPaneStackGranularity = 2; |
59 const TInt KAknNaviPaneStackGranularity = 2; |
|
60 |
|
61 #define Min( x , y ) ((( x ) < ( y )) ? ( x ) : ( y )) |
60 /** |
62 /** |
61 * Extension class for CAknNavigationControlContainer. |
63 * Extension class for CAknNavigationControlContainer. |
62 */ |
64 */ |
63 class CAknNavigationControlContainerExtension : public CBase |
65 class CAknNavigationControlContainerExtension : public CBase |
64 { |
66 { |
70 TInt iCurrentColorScheme; |
72 TInt iCurrentColorScheme; |
71 CAknNaviForegroundObserver* iForegroundObserver; |
73 CAknNaviForegroundObserver* iForegroundObserver; |
72 TBool iDestructionOngoing; |
74 TBool iDestructionOngoing; |
73 CFbsBitmap* iNaviColorBitmap; |
75 CFbsBitmap* iNaviColorBitmap; |
74 TInt iPreferredNaviDecoratorLayoutStyle; |
76 TInt iPreferredNaviDecoratorLayoutStyle; |
75 TBool iIsActiveIdle; |
77 CEikStatusPaneBase* iStatusPane; |
76 }; |
78 }; |
77 |
79 |
78 |
80 |
79 |
81 |
80 // ---------------------------------------------------------------------------- |
82 // ---------------------------------------------------------------------------- |
143 iExtension = |
145 iExtension = |
144 new (ELeave) CAknNavigationControlContainerExtension(); |
146 new (ELeave) CAknNavigationControlContainerExtension(); |
145 iExtension->iCurrentColorScheme = ColorScheme(); |
147 iExtension->iCurrentColorScheme = ColorScheme(); |
146 iExtension->iForegroundObserver = |
148 iExtension->iForegroundObserver = |
147 CAknNaviForegroundObserver::NewL( this ); |
149 CAknNaviForegroundObserver::NewL( this ); |
148 iExtension->iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle(); |
150 iExtension->iStatusPane = CEikStatusPaneBase::Current(); |
149 } |
151 } |
150 |
152 |
151 if ( !iNaviPaneControls ) |
153 if ( !iNaviPaneControls ) |
152 { |
154 { |
153 iNaviPaneControls = |
155 iNaviPaneControls = |
1577 // --------------------------------------------------------------------------- |
1579 // --------------------------------------------------------------------------- |
1578 // |
1580 // |
1579 EXPORT_C void CAknNavigationControlContainer::Draw( |
1581 EXPORT_C void CAknNavigationControlContainer::Draw( |
1580 const TRect& /*aRect*/ ) const |
1582 const TRect& /*aRect*/ ) const |
1581 { |
1583 { |
1582 if ( iExtension->iIsActiveIdle ) |
1584 if ( iExtension->iStatusPane && |
|
1585 iExtension->iStatusPane->IsTransparent() ) |
1583 { |
1586 { |
1584 return; |
1587 return; |
1585 } |
1588 } |
1586 |
1589 |
1587 // Don't allow normal background drawing if |
1590 // Don't allow normal background drawing if |
1922 emptywindow = static_cast <RWindow*> ( drawableWindow ); |
1925 emptywindow = static_cast <RWindow*> ( drawableWindow ); |
1923 } |
1926 } |
1924 } |
1927 } |
1925 } |
1928 } |
1926 |
1929 |
|
1930 TInt minOrd = -1; |
|
1931 |
|
1932 if ( titlewindow ) |
|
1933 { |
|
1934 minOrd = titlewindow->OrdinalPosition(); |
|
1935 } |
|
1936 |
|
1937 if( naviwindow ) |
|
1938 { |
|
1939 minOrd = Min( minOrd, naviwindow->OrdinalPosition() ); |
|
1940 } |
|
1941 |
|
1942 if ( emptywindow ) |
|
1943 { |
|
1944 minOrd = Min( minOrd, emptywindow->OrdinalPosition() ); |
|
1945 } |
|
1946 |
|
1947 |
1927 const TInt last = iNaviPaneControls->Count() - 1; |
1948 const TInt last = iNaviPaneControls->Count() - 1; |
1928 if ( ( last < 0 || !( iNaviPaneControls->At( last ) ) ) || |
1949 if ( ( last < 0 || !( iNaviPaneControls->At( last ) ) ) || |
1929 ( last >= 0 && |
1950 ( last >= 0 && |
1930 iNaviPaneControls->At( last ) && |
1951 iNaviPaneControls->At( last ) && |
1931 iNaviPaneControls->At( last )->ControlType() == |
1952 iNaviPaneControls->At( last )->ControlType() == |
1933 { |
1954 { |
1934 // If not controls in navi stack, send navipane behind of titlepane |
1955 // If not controls in navi stack, send navipane behind of titlepane |
1935 // Minus ordinal ordinal position number always means set |
1956 // Minus ordinal ordinal position number always means set |
1936 // the window to be the last one of the windows with the same |
1957 // the window to be the last one of the windows with the same |
1937 // ordinal priority |
1958 // ordinal priority |
1938 if ( iExtension->iIsActiveIdle )//Added for active idle's transparent |
1959 |
1939 { |
|
1940 if ( titlewindow ) |
1960 if ( titlewindow ) |
1941 { |
1961 { |
1942 titlewindow->SetOrdinalPosition( 4 ); |
1962 titlewindow->SetOrdinalPosition( minOrd ); |
1943 } |
1963 } |
1944 if ( naviwindow ) |
1964 if ( naviwindow ) |
1945 { |
1965 { |
1946 naviwindow->SetOrdinalPosition( 5 ); |
1966 naviwindow->SetOrdinalPosition( minOrd + 1 ); |
1947 } |
1967 } |
1948 if ( emptywindow ) |
1968 if ( emptywindow ) |
1949 { |
1969 { |
1950 emptywindow->SetOrdinalPosition( 6 ); |
1970 emptywindow->SetOrdinalPosition( minOrd + 2 ); |
1951 } |
1971 } |
1952 } |
1972 |
1953 else |
|
1954 { |
|
1955 if ( titlewindow ) |
|
1956 { |
|
1957 titlewindow->SetOrdinalPosition( -1 ); |
|
1958 } |
|
1959 if ( naviwindow ) |
|
1960 { |
|
1961 naviwindow->SetOrdinalPosition( -1 ); |
|
1962 } |
|
1963 if ( emptywindow ) |
|
1964 { |
|
1965 emptywindow->SetOrdinalPosition( -1 ); |
|
1966 } |
|
1967 } |
|
1968 } |
1973 } |
1969 else |
1974 else |
1970 { |
1975 { |
1971 // If controls in navi stack, send titlepane behind the navipane. |
1976 // If controls in navi stack, send titlepane behind the navipane. |
1972 // Minus ordinal ordinal position number always means set |
1977 // Minus ordinal ordinal position number always means set |
1973 // the window to be the last one of the windows with the same |
1978 // the window to be the last one of the windows with the same |
1974 // ordinal priority |
1979 // ordinal priority |
1975 if ( iExtension->iIsActiveIdle )//Added for active idle's transparent |
1980 |
1976 { |
|
1977 if ( naviwindow ) |
1981 if ( naviwindow ) |
1978 { |
1982 { |
1979 naviwindow->SetOrdinalPosition( 4 ); |
1983 naviwindow->SetOrdinalPosition( minOrd ); |
1980 } |
1984 } |
1981 if ( titlewindow ) |
1985 if ( titlewindow ) |
1982 { |
1986 { |
1983 titlewindow->SetOrdinalPosition( 5 ); |
1987 titlewindow->SetOrdinalPosition( minOrd + 1 ); |
1984 } |
1988 } |
1985 if ( emptywindow ) |
1989 if ( emptywindow ) |
1986 { |
1990 { |
1987 emptywindow->SetOrdinalPosition( 6 ); |
1991 emptywindow->SetOrdinalPosition( minOrd + 2 ); |
1988 } |
1992 } |
1989 } |
|
1990 else |
|
1991 { |
|
1992 if ( naviwindow ) |
|
1993 { |
|
1994 naviwindow->SetOrdinalPosition( -1 ); |
|
1995 } |
|
1996 if ( titlewindow ) |
|
1997 { |
|
1998 titlewindow->SetOrdinalPosition( -1 ); |
|
1999 } |
|
2000 if ( emptywindow ) |
|
2001 { |
|
2002 emptywindow->SetOrdinalPosition( -1 ); |
|
2003 } |
|
2004 } |
|
2005 } |
1993 } |
2006 |
1994 |
2007 // Finally request titlepane to refresh itself. |
1995 // Finally request titlepane to refresh itself. |
2008 if( titlecontrol ) |
1996 if( titlecontrol ) |
2009 { |
1997 { |