92 // CCalenIconDrawer::SetIconSizesFromLayout |
92 // CCalenIconDrawer::SetIconSizesFromLayout |
93 // Calculate icon size from layout |
93 // Calculate icon size from layout |
94 // (other items were commented in a header). |
94 // (other items were commented in a header). |
95 // --------------------------------------------------------------------------- |
95 // --------------------------------------------------------------------------- |
96 // |
96 // |
97 void CCalenIconDrawer::SetIconSizesFromLayout(TInt aNumOfLinesBefLocField) |
97 void CCalenIconDrawer::SetIconSizesFromLayout() |
98 { |
98 { |
99 TRACE_ENTRY_POINT; |
99 TRACE_ENTRY_POINT; |
100 |
100 |
101 TSize main_pane_size; |
101 TSize main_pane_size; |
102 AknLayoutUtils::LayoutMetricsSize (AknLayoutUtils::EMainPane, main_pane_size); |
102 AknLayoutUtils::LayoutMetricsSize (AknLayoutUtils::EMainPane, main_pane_size); |
119 iSecondIconRect = icon_layout_rect.Rect(); |
119 iSecondIconRect = icon_layout_rect.Rect(); |
120 |
120 |
121 icon_layout_rect.LayoutRect( list_cale_ev2_pane.Rect(), AknLayoutScalable_Apps::field_cale_ev2_pane_g3(2).LayoutLine() ); |
121 icon_layout_rect.LayoutRect( list_cale_ev2_pane.Rect(), AknLayoutScalable_Apps::field_cale_ev2_pane_g3(2).LayoutLine() ); |
122 iThirdIconRect = icon_layout_rect.Rect(); |
122 iThirdIconRect = icon_layout_rect.Rect(); |
123 |
123 |
124 // Adjust the map icon size |
|
125 if(isMapIconAdded) |
|
126 { |
|
127 TInt mapIconIndex = IconIndex(MCalenServices::ECalenMapIcon); |
|
128 TAknLayoutRect field_cale_ev2_pane; |
|
129 field_cale_ev2_pane.LayoutRect(list_cale_ev2_pane.Rect(), AknLayoutScalable_Apps::field_cale_ev2_pane(aNumOfLinesBefLocField, 0, 0).LayoutLine() ); |
|
130 |
|
131 icon_layout_rect.LayoutRect( field_cale_ev2_pane.Rect(), AknLayoutScalable_Apps::field_cale_ev2_pane_g4(0).LayoutLine() ); |
|
132 SetMapIconSize(icon_layout_rect.Rect()); |
|
133 } |
|
134 AknIconUtils::SetSize( iIconArray->At(iFirstIconIndex)->Bitmap(), iFirstIconRect.Size() ); |
124 AknIconUtils::SetSize( iIconArray->At(iFirstIconIndex)->Bitmap(), iFirstIconRect.Size() ); |
135 AknIconUtils::SetSize( iIconArray->At(iSecondIconIndex)->Bitmap(), iSecondIconRect.Size() ); |
125 AknIconUtils::SetSize( iIconArray->At(iSecondIconIndex)->Bitmap(), iSecondIconRect.Size() ); |
136 AknIconUtils::SetSize( iIconArray->At(iThirdIconIndex)->Bitmap(), iThirdIconRect.Size() ); |
126 AknIconUtils::SetSize( iIconArray->At(iThirdIconIndex)->Bitmap(), iThirdIconRect.Size() ); |
137 |
127 |
138 TRACE_EXIT_POINT; |
128 TRACE_EXIT_POINT; |
139 } |
129 } |
140 |
130 |
141 // --------------------------------------------------------------------------- |
|
142 // CCalenIconDrawer::SetMapIconSize |
|
143 // Fuction to set map icon size |
|
144 // (other items were commented in a header). |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 void CCalenIconDrawer::SetMapIconSize(TRect aIconRect) |
|
148 { |
|
149 TRACE_ENTRY_POINT; |
|
150 |
|
151 if(iIconIndices[iFirstIconIndex] == MCalenServices::ECalenMapIcon) |
|
152 { |
|
153 iFirstIconRect = aIconRect; |
|
154 iFirstIconRect.iBr.iX = iFirstIconRect.iTl.iX + 30; |
|
155 iFirstIconRect.iBr.iY = iFirstIconRect.iTl.iY + 30; |
|
156 } |
|
157 else if(iIconIndices[iSecondIconIndex] == MCalenServices::ECalenMapIcon) |
|
158 { |
|
159 iSecondIconRect = aIconRect; |
|
160 iSecondIconRect.iBr.iX = iSecondIconRect.iTl.iX + 30; |
|
161 iSecondIconRect.iBr.iY = iSecondIconRect.iTl.iY + 30; |
|
162 } |
|
163 else if(iIconIndices[iThirdIconIndex] == MCalenServices::ECalenMapIcon) |
|
164 { |
|
165 iThirdIconRect = aIconRect; |
|
166 iThirdIconRect.iBr.iX = iThirdIconRect.iTl.iX + 30; |
|
167 iThirdIconRect.iBr.iY = iThirdIconRect.iTl.iY + 30; |
|
168 } |
|
169 |
|
170 TRACE_EXIT_POINT; |
|
171 } |
|
172 // --------------------------------------------------------------------------- |
131 // --------------------------------------------------------------------------- |
173 // CCalenIconDrawer::CCalenIconDrawer |
132 // CCalenIconDrawer::CCalenIconDrawer |
174 // C++ constructor can NOT contain any code, that might leave. |
133 // C++ constructor can NOT contain any code, that might leave. |
175 // (other items were commented in a header). |
134 // (other items were commented in a header). |
176 // --------------------------------------------------------------------------- |
135 // --------------------------------------------------------------------------- |