return mImpl->mMaximumNumberOfCharacters;
}
-void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily, bool userDefined )
+void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily )
{
if( !mImpl->mFontDefaults )
{
}
mImpl->mFontDefaults->mFontDescription.family = defaultFontFamily;
- DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultFontFamily %s userDefined: %s\n", defaultFontFamily.c_str(), userDefined ? "true":"false" );
- mImpl->mUserDefinedFontFamily = userDefined;
+ DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultFontFamily %s\n", defaultFontFamily.c_str());
+ mImpl->mUserDefinedFontFamily = true;
// Clear the font-specific data
ClearFontData();
{
DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange");
- ClearFontData();
-
if ( !mImpl->mUserDefinedFontFamily ) // If user defined font then should not update when system font changes
{
DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange newDefaultFont(%s)\n", newDefaultFont.c_str() );
+ ClearFontData();
mImpl->mFontDefaults->mFontDescription.family = newDefaultFont;
mImpl->UpdateModel( ALL_OPERATIONS );
mImpl->QueueModifyEvent( ModifyEvent::TEXT_REPLACED );
for( unsigned int i=0; i<events.size(); ++i )
{
- if( ModifyEvent::TEXT_REPLACED == events[0].type )
+ if( ModifyEvent::TEXT_REPLACED == events[i].type )
{
// A (single) replace event should come first, otherwise we wasted time processing NOOP events
DALI_ASSERT_DEBUG( 0 == i && "Unexpected TEXT_REPLACED event" );
TextReplacedEvent();
}
- else if( ModifyEvent::TEXT_INSERTED == events[0].type )
+ else if( ModifyEvent::TEXT_INSERTED == events[i].type )
{
TextInsertedEvent();
}
- else if( ModifyEvent::TEXT_DELETED == events[0].type )
+ else if( ModifyEvent::TEXT_DELETED == events[i].type )
{
// Placeholder-text cannot be deleted
if( !mImpl->IsShowingPlaceholderText() )
{
mImpl->ChangeState( EventData::INACTIVE );
- if( mImpl->IsShowingPlaceholderText() )
+ if( !mImpl->IsShowingRealText() )
{
// Revert to regular placeholder-text when not editing
ShowPlaceholderText();
else if( EventData::EDITING != mImpl->mEventData->mState &&
EventData::EDITING_WITH_GRAB_HANDLE != mImpl->mEventData->mState )
{
+ if( mImpl->IsShowingPlaceholderText() && ! mImpl->IsFocusedPlaceholderAvailable() )
+ {
+ // Hide placeholder text
+ ResetText();
+ }
// Show cursor on first tap
mImpl->ChangeState( EventData::EDITING );
relayoutNeeded = true;
}
else
{
+ // Reset the imf manger to commit the pre-edit before selecting the text.
+ mImpl->ResetImfManager();
+
SelectEvent( x, y, false );
}
}
case ImfManager::COMMIT:
{
InsertText( imfEvent.predictiveString, Text::Controller::COMMIT );
+ update=true;
requestRelayout = true;
break;
}
if( removed )
{
- // This is to reset the virtual keyboard to Upper-case
- if( 0u == mImpl->mLogicalModel->mText.Count() )
- {
- NotifyImfManager();
- }
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p DALI_KEY_BACKSPACE RemovedText\n", this );
+ // Notifiy the IMF manager after text changed
+ // Automatic Upper-case and restarting prediction on an existing word require this.
+ NotifyImfManager();
if( 0u != mImpl->mLogicalModel->mText.Count() ||
!mImpl->IsPlaceholderAvailable() )