614 |
614 |
615 aItemDrawer->SetHighlightedTextColor(color); |
615 aItemDrawer->SetHighlightedTextColor(color); |
616 aItemDrawer->SetHighlightedBackColor(AKN_LAF_COLOR_STATIC( |
616 aItemDrawer->SetHighlightedBackColor(AKN_LAF_COLOR_STATIC( |
617 AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_2(TRect(0,0,0,0)).iC)); |
617 AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_2(TRect(0,0,0,0)).iC)); |
618 } |
618 } |
619 |
619 |
620 TInt AknListBoxLayouts::AdjustPopupLayoutData( const TRect& aScreenRect ) |
620 |
621 { |
|
622 _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ ); |
|
623 TInt width = aScreenRect.Width(); |
|
624 TInt height = aScreenRect.Height(); |
|
625 |
|
626 if ( width ==640 && height ==360 ) //QHD |
|
627 { |
|
628 return 32; |
|
629 } |
|
630 else if(( width ==320 && height ==240 ) //QVGA, QVGA2 |
|
631 ||( width ==640 && height ==480 )) //VGA, VAG3 |
|
632 { |
|
633 return 0; |
|
634 } |
|
635 else |
|
636 { |
|
637 Panic( EAknPopupLayoutUnknownResolution ); |
|
638 return 0; |
|
639 } |
|
640 } |
|
641 // ----------------------------------------------------------------------------- |
621 // ----------------------------------------------------------------------------- |
642 // IdFromTextAlign |
622 // IdFromTextAlign |
643 // ----------------------------------------------------------------------------- |
623 // ----------------------------------------------------------------------------- |
644 // |
624 // |
645 static TInt IdFromTextAlign( const CGraphicsContext::TTextAlign aAlign ) |
625 static TInt IdFromTextAlign( const CGraphicsContext::TTextAlign aAlign ) |
1167 TPoint p2) |
1147 TPoint p2) |
1168 { |
1148 { |
1169 SetupFormTextCell( aListBox, aItemDrawer, index, font, C, lm, rm, B, W, aAlign, p1, p2 ); |
1149 SetupFormTextCell( aListBox, aItemDrawer, index, font, C, lm, rm, B, W, aAlign, p1, p2 ); |
1170 } |
1150 } |
1171 |
1151 |
1172 // this is common popuplist setup code |
1152 // ---------------------------------------------------------------------------- |
1173 static TSize PopupListItemSize(const TAknWindowLineLayout &aL) |
1153 // This is common popup list setup code. |
|
1154 // ---------------------------------------------------------------------------- |
|
1155 // |
|
1156 static TSize PopupListItemSize( const TAknWindowLineLayout &aL ) |
1174 { |
1157 { |
1175 _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ ); |
1158 _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ ); |
1176 TAknLayoutRect temp, layout; |
1159 TAknLayoutRect temp; |
|
1160 TAknLayoutRect layout; |
1177 TRect mainPane; |
1161 TRect mainPane; |
1178 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EPopupParent, mainPane ); |
1162 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EPopupParent, mainPane ); |
1179 |
1163 |
1180 temp.LayoutRect( mainPane, AknLayoutScalable_Avkon::popup_menu_window(13)); |
1164 temp.LayoutRect( mainPane, |
|
1165 AknLayoutScalable_Avkon::popup_menu_window( |
|
1166 Layout_Meta_Data::IsLandscapeOrientation() ? 43 : 13 ) ); |
1181 |
1167 |
1182 TRect screenRect; |
1168 TRect screenRect; |
1183 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); |
1169 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); |
1184 TAknWindowLineLayout lineLayout = AknLayoutScalable_Avkon::listscroll_menu_pane(0).LayoutLine(); |
1170 |
1185 |
1171 layout.LayoutRect( temp.Rect(), |
1186 // Layout data of listscroll_menu_pane are changed for CR 417-35260. |
1172 AknLayoutScalable_Avkon::listscroll_menu_pane( 0 ) ); |
1187 // The change is just for QHD landscape model. |
|
1188 // The CR makes listscroll_menu_pane's ir or il bigger than normal, |
|
1189 // so that width of list item is smaller than needs. Then, first cell |
|
1190 // of list item can not be drawn on proper position. |
|
1191 // Adjustment of layout is a solution for this problem. This is not a perfect idea, but |
|
1192 // creating a new layout for popuplist is too complex to do that. Adjustment is a must. |
|
1193 if(Layout_Meta_Data::IsLandscapeOrientation()) |
|
1194 { |
|
1195 TInt offset = AknListBoxLayouts::AdjustPopupLayoutData( screenRect ); |
|
1196 if (!AknLayoutUtils::LayoutMirrored()) |
|
1197 { |
|
1198 lineLayout.ir -= offset; |
|
1199 } |
|
1200 else |
|
1201 { |
|
1202 lineLayout.il -= offset; |
|
1203 } |
|
1204 } |
|
1205 layout.LayoutRect( temp.Rect(), lineLayout); |
|
1206 |
1173 |
1207 temp.LayoutRect( layout.Rect(), AknLayoutScalable_Avkon::list_menu_pane(0)); |
1174 temp.LayoutRect( layout.Rect(), |
1208 layout.LayoutRect( temp.Rect(), aL); |
1175 AknLayoutScalable_Avkon::list_menu_pane( 0 ) ); |
|
1176 layout.LayoutRect( temp.Rect(), aL ); |
1209 |
1177 |
1210 return layout.Rect().Size(); |
1178 return layout.Rect().Size(); |
1211 } |
1179 } |
1212 |
1180 |
1213 static void SetupCommonPopupListL(CEikFormattedCellListBox* aListBox, const TAknWindowLineLayout &aLayout ) |
1181 static void SetupCommonPopupListL(CEikFormattedCellListBox* aListBox, const TAknWindowLineLayout &aLayout ) |
3462 else |
3430 else |
3463 { |
3431 { |
3464 itemDrawer->SetItemMarkPosition( 3 ); |
3432 itemDrawer->SetItemMarkPosition( 3 ); |
3465 itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement ); |
3433 itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement ); |
3466 } |
3434 } |
|
3435 |
|
3436 // Mirrored layout does not have smiley. |
|
3437 if ( !AknLayoutUtils::LayoutMirrored() && |
|
3438 itemDrawer->Flags() & CListItemDrawer::EDrawSmileyIcon ) |
|
3439 { |
|
3440 formattedCellData->InitSmileyL(); |
|
3441 // only second lable can have smiley icon now. |
|
3442 formattedCellData->SetSmileySubCellL(2); |
|
3443 } |
3467 _AKNTRACE_FUNC_EXIT; |
3444 _AKNTRACE_FUNC_EXIT; |
3468 } |
3445 } |
3469 |
3446 |
3470 // ----------------------------------------------------------------------------- |
3447 // ----------------------------------------------------------------------------- |
3471 // CAknDoubleStyleListBox::SizeChanged |
3448 // CAknDoubleStyleListBox::SizeChanged |
3785 } |
3762 } |
3786 |
3763 |
3787 itemDrawer->SetItemMarkReverse( ETrue ); |
3764 itemDrawer->SetItemMarkReverse( ETrue ); |
3788 itemDrawer->SetItemMarkPosition( 3 ); |
3765 itemDrawer->SetItemMarkPosition( 3 ); |
3789 itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement ); |
3766 itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement ); |
|
3767 |
|
3768 // Mirrored layout does not have smiley. |
|
3769 // for conversation |
|
3770 if ( !AknLayoutUtils::LayoutMirrored() && |
|
3771 itemDrawer->Flags() & CListItemDrawer::EDrawSmileyIcon ) |
|
3772 { |
|
3773 formattedCellData->InitSmileyL(); |
|
3774 // only second lable can have smiley icon now. |
|
3775 formattedCellData->SetSmileySubCellL(2); |
|
3776 } |
3790 _AKNTRACE_FUNC_EXIT; |
3777 _AKNTRACE_FUNC_EXIT; |
3791 } |
3778 } |
3792 |
3779 |
3793 // ----------------------------------------------------------------------------- |
3780 // ----------------------------------------------------------------------------- |
3794 // CAknDoubleStyle2ListBox::SizeChanged |
3781 // CAknDoubleStyle2ListBox::SizeChanged |