BIDI_INFO |
SHAPE_TEXT |
GET_GLYPH_METRICS );
+
+ // Set the update info to relayout the whole text.
+ mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
+ mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mModel->mLogicalModel->mText.Count();
+
// Make sure the model is up-to-date before layouting
mImpl->UpdateModel( onlyOnceOperations );
// Layout the text for the new width.
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | LAYOUT );
- // Set the update info to relayout the whole text.
- mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
- mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mModel->mLogicalModel->mText.Count();
-
// Store the actual control's size to restore later.
const Size actualControlSize = mImpl->mModel->mVisualModel->mControlSize;
BIDI_INFO |
SHAPE_TEXT |
GET_GLYPH_METRICS );
+
+ // Set the update info to relayout the whole text.
+ mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
+ mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mModel->mLogicalModel->mText.Count();
+
// Make sure the model is up-to-date before layouting
mImpl->UpdateModel( onlyOnceOperations );
// Layout the text for the new width.
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | LAYOUT );
- // Set the update info to relayout the whole text.
- mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
- mImpl->mTextUpdateInfo.mRequestedNumberOfCharacters = mImpl->mModel->mLogicalModel->mText.Count();
-
// Store the actual control's width.
const float actualControlWidth = mImpl->mModel->mVisualModel->mControlSize.width;
{
textChanged = BackspaceKeyEvent();
}
- else if( IsKey( keyEvent, Dali::DALI_KEY_POWER ) )
- {
- mImpl->ChangeState( EventData::INTERRUPTED ); // State is not INACTIVE as expect to return to edit mode.
- // Avoids calling the InsertText() method which can delete selected text
- }
- else if( IsKey( keyEvent, Dali::DALI_KEY_MENU ) ||
+ else if( IsKey( keyEvent, Dali::DALI_KEY_POWER ) ||
+ IsKey( keyEvent, Dali::DALI_KEY_MENU ) ||
IsKey( keyEvent, Dali::DALI_KEY_HOME ) )
{
+ // Power key/Menu/Home key behaviour does not allow edit mode to resume.
mImpl->ChangeState( EventData::INACTIVE );
- // Menu/Home key behaviour does not allow edit mode to resume like Power key
- // Avoids calling the InsertText() method which can delete selected text
+
+ // This branch avoids calling the InsertText() method of the 'else' branch which can delete selected text.
}
else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode )
{
numberOfCharacters = currentText.Count() - cursorIndex;
}
- if( ( cursorIndex + numberOfCharacters ) <= mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters )
+ if( mImpl->mEventData->mPreEditFlag || // If the preedit flag is enabled, it means two (or more) of them came together i.e. when two keys have been pressed at the same time.
+ ( ( cursorIndex + numberOfCharacters ) <= mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters ) )
{
// Mark the paragraphs to be updated.
mImpl->mTextUpdateInfo.mCharacterIndex = std::min( cursorIndex, mImpl->mTextUpdateInfo.mCharacterIndex );