if( mImpl->mEventData )
{
- mImpl->ChangeState( EventData::EDITING );
+ if( ( EventData::INACTIVE == mImpl->mEventData->mState ) ||
+ ( EventData::INTERRUPTED == mImpl->mEventData->mState ) )
+ {
+ mImpl->ChangeState( EventData::EDITING );
+ mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered.
+ }
if( mImpl->IsShowingPlaceholderText() )
{
ShowPlaceholderText();
}
- mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered.
mImpl->RequestRelayout();
}
}
textChanged = true;
}
- if ( mImpl->mEventData->mState != EventData::INTERRUPTED && mImpl->mEventData->mState != EventData::INACTIVE )
+ if ( ( mImpl->mEventData->mState != EventData::INTERRUPTED ) &&
+ ( mImpl->mEventData->mState != EventData::INACTIVE ) )
{
mImpl->ChangeState( EventData::EDITING );
}
mImpl->mEventData->mPreEditLength = utf32Characters.Count();
mImpl->mEventData->mPreEditFlag = true;
- if( 0u != mImpl->mVisualModel->mCharactersToGlyph.Count() )
- {
- // Add the underline for the pre-edit text.
- const GlyphIndex* const charactersToGlyphBuffer = mImpl->mVisualModel->mCharactersToGlyph.Begin();
- const Length* const glyphsPerCharacterBuffer = mImpl->mVisualModel->mGlyphsPerCharacter.Begin();
-
- const GlyphIndex glyphStart = *( charactersToGlyphBuffer + mImpl->mEventData->mPreEditStartPosition );
- const CharacterIndex lastPreEditCharacter = mImpl->mEventData->mPreEditStartPosition + ( ( mImpl->mEventData->mPreEditLength > 0u ) ? mImpl->mEventData->mPreEditLength - 1u : 0u );
- const Length numberOfGlyphsLastCharacter = *( glyphsPerCharacterBuffer + lastPreEditCharacter );
- const GlyphIndex glyphEnd = *( charactersToGlyphBuffer + lastPreEditCharacter ) + ( numberOfGlyphsLastCharacter > 1u ? numberOfGlyphsLastCharacter - 1u : 0u );
-
- GlyphRun underlineRun;
- underlineRun.glyphIndex = glyphStart;
- underlineRun.numberOfGlyphs = 1u + glyphEnd - glyphStart;
-
- // TODO: At the moment the underline runs are only for pre-edit.
- mImpl->mVisualModel->mUnderlineRuns.PushBack( underlineRun );
- }
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "mPreEditStartPosition %d mPreEditLength %d\n", mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength );
}
}
if( NULL != mImpl->mEventData )
{
- const bool isShowingPlaceholderText = mImpl->IsShowingPlaceholderText();
if( 1u == tapCount )
{
- if( !isShowingPlaceholderText &&
- ( EventData::EDITING == mImpl->mEventData->mState ) )
+ if( mImpl->IsShowingRealText() &&
+ EventData::EDITING == mImpl->mEventData->mState )
{
mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE );
}
mImpl->RequestRelayout();
}
- else if( !isShowingPlaceholderText &&
- mImpl->mEventData->mSelectionEnabled &&
- ( 2u == tapCount ) )
+ else if( 2u == tapCount )
{
- SelectEvent( x, y, false );
+ if( mImpl->mEventData->mSelectionEnabled &&
+ mImpl->IsShowingRealText() )
+ {
+ SelectEvent( x, y, false );
+ }
}
}