183 // CESMRViewerDescriptionField::SizeChanged() |
183 // CESMRViewerDescriptionField::SizeChanged() |
184 // --------------------------------------------------------------------------- |
184 // --------------------------------------------------------------------------- |
185 // |
185 // |
186 void CESMRViewerDescriptionField::SizeChanged() |
186 void CESMRViewerDescriptionField::SizeChanged() |
187 { |
187 { |
|
188 // Store iRichTextViewer original width. |
|
189 TInt richTextViewerWidth = iRichTextViewer->Size().iWidth; |
188 TRect rect( Rect() ); |
190 TRect rect( Rect() ); |
189 rect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ).Rect(); |
191 rect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ).Rect(); |
190 |
192 |
191 TRect viewerRect = |
193 TRect viewerRect = |
192 NMRLayoutManager::GetLayoutText( |
194 NMRLayoutManager::GetLayoutText( |
209 iRichTextViewer->SetFontL( text.Font() ); |
211 iRichTextViewer->SetFontL( text.Font() ); |
210 // Try applying changes |
212 // Try applying changes |
211 iRichTextViewer->ApplyLayoutChangesL(); |
213 iRichTextViewer->ApplyLayoutChangesL(); |
212 ); |
214 ); |
213 |
215 |
214 iRichTextViewer->SetRect( |
216 if ( iRichTextViewer->Size().iWidth != richTextViewerWidth ) |
215 TRect( viewerRect.iTl, |
217 { |
216 TSize( viewerRect.Width(), iSize.iHeight ) ) ); |
218 // Most of this case is screen orientation, in this case we need to |
217 |
219 // Record the index of focusing link, after updating link array, then |
218 bgRect.SetHeight( iRichTextViewer->Rect().Height() ); |
220 // reset the focusing to original one. |
219 SetFocusRect( bgRect ); |
221 TInt focusingIndex = iRichTextViewer->GetFocusLink(); |
|
222 if ( KErrNotFound != focusingIndex ) |
|
223 { |
|
224 iRichTextViewer->SetFocusLink( focusingIndex ); |
|
225 //wake up current contact menu selection by calling this |
|
226 iRichTextViewer->FocusChanged(ENoDrawNow); |
|
227 } |
|
228 } |
220 } |
229 } |
221 |
230 |
222 // --------------------------------------------------------------------------- |
231 // --------------------------------------------------------------------------- |
223 // CESMRViewerDescriptionField::CountComponentControls() |
232 // CESMRViewerDescriptionField::CountComponentControls() |
224 // --------------------------------------------------------------------------- |
233 // --------------------------------------------------------------------------- |