83 FUNC_LOG; |
83 FUNC_LOG; |
84 CEikDialog::HandleResourceChange( aType ); |
84 CEikDialog::HandleResourceChange( aType ); |
85 if ( aType == KAknsMessageSkinChange ) |
85 if ( aType == KAknsMessageSkinChange ) |
86 { |
86 { |
87 UpdateGraphics(); |
87 UpdateGraphics(); |
88 UpdateColors(); |
|
89 } |
|
90 else if ( aType == KEikMessageColorSchemeChange ) |
|
91 { |
|
92 UpdateColors(); |
|
93 } |
88 } |
94 else if ( aType == KEikDynamicLayoutVariantSwitch ) |
89 else if ( aType == KEikDynamicLayoutVariantSwitch ) |
95 { |
90 { |
96 |
91 |
97 // for some reason formatted cell listbox loses settings |
92 // for some reason formatted cell listbox loses settings |
98 // when layout is switched |
93 // when layout is switched |
99 if ( !iColumnListBox ) |
94 if ( !iColumnListBox ) |
100 { |
95 { |
101 UpdateGraphics(); |
96 UpdateGraphics(); |
102 UpdateColors(); |
|
103 } |
97 } |
104 } |
98 } |
105 } |
99 } |
106 |
100 |
107 // --------------------------------------------------------------------------- |
101 // --------------------------------------------------------------------------- |
239 } |
233 } |
240 } |
234 } |
241 |
235 |
242 } |
236 } |
243 |
237 |
244 // --------------------------------------------------------------------------- |
|
245 // CPbkxRclBaseDlg::UpdateColors |
|
246 // --------------------------------------------------------------------------- |
|
247 // |
|
248 void CPbkxRclBaseDlg::UpdateColors() |
|
249 { |
|
250 FUNC_LOG; |
|
251 |
|
252 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
253 |
|
254 CPbkxRclResultInfoItemDrawer* fItemDrawer = NULL; |
|
255 CPbkxRclSearchResultItemDrawer* cItemDrawer = NULL; |
|
256 |
|
257 if ( iColumnListBox ) |
|
258 { |
|
259 CEikColumnListBox* listBox = |
|
260 static_cast<CEikColumnListBox*>( ListBox() ); |
|
261 cItemDrawer = static_cast<CPbkxRclSearchResultItemDrawer*>( |
|
262 listBox->ItemDrawer() ); |
|
263 } |
|
264 else |
|
265 { |
|
266 CEikFormattedCellListBox* listBox = |
|
267 static_cast<CEikFormattedCellListBox*>( ListBox() ); |
|
268 fItemDrawer = static_cast<CPbkxRclResultInfoItemDrawer*>( |
|
269 listBox->ItemDrawer() ); |
|
270 } |
|
271 |
|
272 TRgb newColor; |
|
273 |
|
274 // highlight text color |
|
275 TInt error = AknsUtils::GetCachedColor( |
|
276 skin, |
|
277 newColor, |
|
278 iHighlightTextColorId, |
|
279 EAknsCIFsHighlightColorsCG1 ); |
|
280 |
|
281 |
|
282 if ( error == KErrNone ) |
|
283 { |
|
284 if ( iColumnListBox ) |
|
285 { |
|
286 cItemDrawer->SetHighlightColor( newColor ); |
|
287 } |
|
288 else |
|
289 { |
|
290 fItemDrawer->SetHighlightColor( newColor ); |
|
291 } |
|
292 } |
|
293 else |
|
294 { |
|
295 if ( iColumnListBox ) |
|
296 { |
|
297 cItemDrawer->ResetColors( ETrue ); |
|
298 } |
|
299 else |
|
300 { |
|
301 fItemDrawer->ResetColors( ETrue ); |
|
302 } |
|
303 } |
|
304 |
|
305 // text color |
|
306 error = AknsUtils::GetCachedColor( |
|
307 skin, |
|
308 newColor, |
|
309 iTextColorId, |
|
310 EAknsCIFsTextColorsCG7 ); |
|
311 |
|
312 |
|
313 if ( error == KErrNone ) |
|
314 { |
|
315 if ( iColumnListBox ) |
|
316 { |
|
317 cItemDrawer->SetColor( newColor ); |
|
318 } |
|
319 else |
|
320 { |
|
321 fItemDrawer->SetColor( newColor ); |
|
322 } |
|
323 } |
|
324 else |
|
325 { |
|
326 if ( iColumnListBox ) |
|
327 { |
|
328 cItemDrawer->ResetColors(); |
|
329 } |
|
330 else |
|
331 { |
|
332 fItemDrawer->ResetColors(); |
|
333 } |
|
334 } |
|
335 } |
|
336 |
|