44 const int KFastScrollAnimFactorInc = 40; |
44 const int KFastScrollAnimFactorInc = 40; |
45 const int KMaxAnimFactor = 100; |
45 const int KMaxAnimFactor = 100; |
46 const int KMinAnimFactor = 0; |
46 const int KMinAnimFactor = 0; |
47 const int KMinimumScroll = 20; |
47 const int KMinimumScroll = 20; |
48 |
48 |
49 #define KCenterImageBorderColor KRgbRed |
49 #define KCenterImageBorderColor TRgb(179,179,181) |
50 #define KSideImageBorderColor KRgbBlack |
50 #define KSideImageBorderColor KRgbBlack |
|
51 #define KSideImageMaskColor TRgb( 170, 170, 170, 150 ) |
51 |
52 |
52 // ============================= LOCAL FUNCTIONS =============================== |
53 // ============================= LOCAL FUNCTIONS =============================== |
53 |
54 |
54 TBool animRepaint(TAny* aAny) |
55 TBool animRepaint(TAny* aAny) |
55 { |
56 { |
263 // |
264 // |
264 void HistoryView::updateDisplay() |
265 void HistoryView::updateDisplay() |
265 { |
266 { |
266 m_bitmapContext->Clear(); |
267 m_bitmapContext->Clear(); |
267 m_bitmapContext->Reset(); |
268 m_bitmapContext->Reset(); |
|
269 |
|
270 m_bitmapContext->SetPenColor(TRgb(45,44,50)); |
|
271 m_bitmapContext->SetPenStyle(CGraphicsContext::ESolidPen); |
|
272 m_bitmapContext->SetBrushColor(KRgbDarkGray); |
|
273 m_bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
274 m_bitmapContext->DrawRect(Rect()); |
|
275 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
276 m_bitmapContext->SetPenStyle(CGraphicsContext::ENullPen); |
|
277 |
268 |
278 |
269 // updateDisplay something to the bitmap |
279 // updateDisplay something to the bitmap |
270 m_centerEntry = m_historyController->entryByIndex( m_centerPageIndex ); |
280 m_centerEntry = m_historyController->entryByIndex( m_centerPageIndex ); |
271 HistoryEntry* leftEntry = m_historyController->entryByIndex( m_centerPageIndex-1 ); |
281 HistoryEntry* leftEntry = m_historyController->entryByIndex( m_centerPageIndex-1 ); |
272 HistoryEntry* rightEntry = m_historyController->entryByIndex( m_centerPageIndex+1 ); |
282 HistoryEntry* rightEntry = m_historyController->entryByIndex( m_centerPageIndex+1 ); |
275 TRAP_IGNORE(leftEntry->constructThumbnailL()); |
285 TRAP_IGNORE(leftEntry->constructThumbnailL()); |
276 } |
286 } |
277 if (leftEntry->thumbnail()) { |
287 if (leftEntry->thumbnail()) { |
278 m_bitmapContext->BitBlt( m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()) ); |
288 m_bitmapContext->BitBlt( m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()) ); |
279 } |
289 } |
280 m_bitmapContext->SetPenColor( KSideImageBorderColor ); |
290 |
|
291 m_bitmapContext->SetBrushColor ( KSideImageMaskColor ); |
|
292 m_bitmapContext->SetBrushStyle ( CWindowGc::ESolidBrush ); |
281 m_bitmapContext->DrawRect(m_leftPlaceHolderRect); |
293 m_bitmapContext->DrawRect(m_leftPlaceHolderRect); |
|
294 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
282 } |
295 } |
283 // updateDisplay the next thumbnail |
296 // updateDisplay the next thumbnail |
284 if (rightEntry) { |
297 if (rightEntry) { |
285 if (!rightEntry->thumbnail()) { |
298 if (!rightEntry->thumbnail()) { |
286 TRAP_IGNORE(rightEntry->constructThumbnailL()); |
299 TRAP_IGNORE(rightEntry->constructThumbnailL()); |
287 } |
300 } |
288 if (rightEntry->thumbnail()) { |
301 if (rightEntry->thumbnail()) { |
289 m_bitmapContext->BitBlt( m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()) ); |
302 m_bitmapContext->BitBlt( m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()) ); |
290 } |
303 } |
291 m_bitmapContext->SetPenColor( KSideImageBorderColor ); |
304 |
|
305 m_bitmapContext->SetBrushColor ( KSideImageMaskColor ); |
|
306 m_bitmapContext->SetBrushStyle ( CWindowGc::ESolidBrush ); |
292 m_bitmapContext->DrawRect(m_rightPlaceHolderRect); |
307 m_bitmapContext->DrawRect(m_rightPlaceHolderRect); |
|
308 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
293 } |
309 } |
294 // updateDisplay the center thumbnail |
310 // updateDisplay the center thumbnail |
295 if (m_centerEntry ) { |
311 if (m_centerEntry ) { |
296 if (!m_centerEntry->thumbnail()) { |
312 if (!m_centerEntry->thumbnail()) { |
297 TRAP_IGNORE(m_centerEntry->constructThumbnailL()); |
313 TRAP_IGNORE(m_centerEntry->constructThumbnailL()); |
298 } |
314 } |
299 if (m_centerEntry->thumbnail()) { |
315 if (m_centerEntry->thumbnail()) { |
|
316 m_bitmapContext->SetBrushColor(KRgbWhite); |
|
317 m_bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
318 m_bitmapContext->DrawRect(m_centerPlaceHolderRect); |
|
319 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
320 TSize bitSize = m_centerEntry->thumbnail()->SizeInPixels(); |
300 m_bitmapContext->BitBlt( m_centerPlaceHolderRect.iTl, m_centerEntry->thumbnail(), TRect(TPoint(0,0), m_centerPlaceHolderRect.Size()) ); |
321 m_bitmapContext->BitBlt( m_centerPlaceHolderRect.iTl, m_centerEntry->thumbnail(), TRect(TPoint(0,0), m_centerPlaceHolderRect.Size()) ); |
301 } |
322 } |
302 } |
323 } |
|
324 |
|
325 //Draw border for center thumbnail |
|
326 m_bitmapContext->SetPenStyle( CGraphicsContext:: ESolidPen ); |
303 m_bitmapContext->SetPenColor( KCenterImageBorderColor ); |
327 m_bitmapContext->SetPenColor( KCenterImageBorderColor ); |
304 |
|
305 m_bitmapContext->DrawRect( m_centerPlaceHolderRect ); |
328 m_bitmapContext->DrawRect( m_centerPlaceHolderRect ); |
306 |
329 |
307 // Reset Brush |
330 // Reset Brush |
308 m_bitmapContext->SetBrushColor(TRgb(255,255,255)); |
331 m_bitmapContext->SetBrushColor(TRgb(255,255,255)); |
309 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
332 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
333 m_bitmapContext->SetPenStyle(CGraphicsContext::ENullPen); |
310 // updateState(-1); |
334 // updateState(-1); |
311 } |
335 } |
312 |
336 |
313 // ---------------------------------------------------------------------------- |
337 // ---------------------------------------------------------------------------- |
314 // HistoryView::getCenterEntryTitle |
338 // HistoryView::getCenterEntryTitle |