equal
deleted
inserted
replaced
65 // spacing in pixels for scroll bars |
65 // spacing in pixels for scroll bars |
66 #define KKeymapHScrollbarSize 4 |
66 #define KKeymapHScrollbarSize 4 |
67 #define KKeymapVScrollbarSize 4 |
67 #define KKeymapVScrollbarSize 4 |
68 |
68 |
69 // sizing for entire keymap (not counting scrollbar) |
69 // sizing for entire keymap (not counting scrollbar) |
70 // as a percentage of vertical screen size, and an aspect ratio width/height |
70 // as a percentage of vertical and horizontal screen size |
71 #define KKeymapVSize 0.90 |
71 #define KKeymapVSize 0.90 |
72 #define KKeymapHVAspectRatio 0.88 |
|
73 #define KKeymapHSize 0.90 |
72 #define KKeymapHSize 0.90 |
74 |
73 |
75 // margins for each cell |
74 // margins for each cell |
76 #define KCellTopMargin 2 |
75 #define KCellTopMargin 2 |
77 #define KCellRightMargin 5 |
76 #define KCellRightMargin 5 |
271 // derive keymap's size from the container's size |
270 // derive keymap's size from the container's size |
272 iTargetRect = iContentViewContainer->Rect(); |
271 iTargetRect = iContentViewContainer->Rect(); |
273 |
272 |
274 // resize it to account for scrollbar width/height |
273 // resize it to account for scrollbar width/height |
275 iTargetRect.Resize(-TSize(KKeymapHScrollbarSize,KKeymapVScrollbarSize)); |
274 iTargetRect.Resize(-TSize(KKeymapHScrollbarSize,KKeymapVScrollbarSize)); |
|
275 |
|
276 TBool landscape = iTargetRect.Size().iWidth > iTargetRect.Size().iHeight ; |
276 |
277 |
277 // |
278 // |
278 // derive shrink amounts based on keymap size constants and shrink the rect |
279 // derive shrink amounts based on keymap size constants and shrink the rect |
279 // |
280 // |
280 TInt newHeight = (KKeymapVSize * iTargetRect.Size().iHeight); |
281 TInt newHeight = (KKeymapVSize * iTargetRect.Size().iHeight); |
281 //TInt newWidth = (KKeymapHSize * iTargetRect.Size().iWidth); |
282 TInt newWidth = (KKeymapHSize * iTargetRect.Size().iWidth); |
282 TInt newWidth = newHeight * KKeymapHVAspectRatio; |
283 |
283 |
|
284 if(newWidth > KKeymapHSize * iTargetRect.Size().iWidth) |
284 if(newWidth > KKeymapHSize * iTargetRect.Size().iWidth) |
285 { |
285 { |
286 newWidth = (KKeymapHSize * iTargetRect.Size().iWidth); |
286 newWidth = (KKeymapHSize * iTargetRect.Size().iWidth); |
287 } |
287 } |
288 |
288 |
304 TInt vShrink = (iTargetRect.Size().iHeight - newHeight)/2; |
304 TInt vShrink = (iTargetRect.Size().iHeight - newHeight)/2; |
305 iTargetRect.Shrink(TSize(hShrink,vShrink)); |
305 iTargetRect.Shrink(TSize(hShrink,vShrink)); |
306 |
306 |
307 // Set font types |
307 // Set font types |
308 iLineFont = LatinPlain12(); |
308 iLineFont = LatinPlain12(); |
309 iKeyFont = LatinBold16(); |
309 |
|
310 if (landscape) |
|
311 { // in landscape need to shrink the font or else it gets clipped |
|
312 iKeyFont = LatinBold13(); |
|
313 } |
|
314 else |
|
315 { |
|
316 iKeyFont = LatinBold16(); |
|
317 } |
310 |
318 |
311 // init cell data |
319 // init cell data |
312 InitCellDataL(); |
320 InitCellDataL(); |
313 } |
321 } |
314 |
322 |