X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=ff7de02ff483b21b09d14967719bee08be119582;hp=0ada75e728a88d8c31d28faa4a82609688de7d67;hb=77a31b18a427cfc72cb17f0b14925694ea638851;hpb=63c8495b30e5bbf76548256887eee20e00e256e2 diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 0ada75e..ff7de02 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -25,6 +25,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -346,6 +347,7 @@ void Controller::SetMultiLineEnabled( bool enable ) ALIGN | REORDER ); + mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true; mImpl->mOperationsPending = static_cast( mImpl->mOperationsPending | layoutOperations ); mImpl->RequestRelayout(); @@ -2097,6 +2099,17 @@ void Controller::GetPlaceholderProperty( Property::Map& map ) } } +Toolkit::DevelText::TextDirection::Type Controller::GetTextDirection() +{ + const LineRun* const firstline = mImpl->mModel->mVisualModel->mLines.Begin(); + if ( firstline && firstline->direction ) + { + return Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT; + } + + return Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT; +} + // public : Relayout. Controller::UpdateTextType Controller::Relayout( const Size& size ) @@ -2330,7 +2343,7 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) // Do nothing. return false; } - else if( Dali::DALI_KEY_ESCAPE == keyCode || Dali::DALI_KEY_BACK == keyCode ) + else if( Dali::DALI_KEY_ESCAPE == keyCode || Dali::DALI_KEY_BACK == keyCode || Dali::DALI_KEY_SEARCH == keyCode ) { // Do nothing return false; @@ -2370,9 +2383,10 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) // Will request for relayout. relayoutNeeded = true; } - else if( Dali::DALI_KEY_BACKSPACE == keyCode ) + else if( ( Dali::DALI_KEY_BACKSPACE == keyCode ) || + ( Dali::DevelKey::DALI_KEY_DELETE == keyCode ) ) { - textChanged = BackspaceKeyEvent(); + textChanged = DeleteEvent( keyCode ); // Will request for relayout. relayoutNeeded = true; @@ -3319,6 +3333,7 @@ bool Controller::DoRelayout( const Size& size, const Vector& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters; const Vector& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph; const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin(); + float outlineWidth = mImpl->mModel->GetOutlineWidth(); // Set the layout parameters. Layout::Parameters layoutParameters( size, @@ -3333,7 +3348,8 @@ bool Controller::DoRelayout( const Size& size, glyphsPerCharacterBuffer, totalNumberOfGlyphs, mImpl->mModel->mHorizontalAlignment, - mImpl->mModel->mLineWrapMode ); + mImpl->mModel->mLineWrapMode, + outlineWidth ); // Resize the vector of positions to have the same size than the vector of glyphs. Vector& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions; @@ -3615,9 +3631,9 @@ void Controller::SelectEvent( float x, float y, bool selectAll ) } } -bool Controller::BackspaceKeyEvent() +bool Controller::DeleteEvent( int keyCode ) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p DALI_KEY_BACKSPACE\n", this ); + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p KeyCode : %d \n", this, keyCode ); bool removed = false; @@ -3633,13 +3649,20 @@ bool Controller::BackspaceKeyEvent() { removed = RemoveSelectedText(); } - else if( mImpl->mEventData->mPrimaryCursorPosition > 0 ) + else if( ( mImpl->mEventData->mPrimaryCursorPosition > 0 ) && ( keyCode == Dali::DALI_KEY_BACKSPACE) ) { // Remove the character before the current cursor position removed = RemoveText( -1, 1, UPDATE_INPUT_STYLE ); } + else if( ( mImpl->mEventData->mPrimaryCursorPosition >= 0 ) && ( keyCode == Dali::DevelKey::DALI_KEY_DELETE ) ) + { + // Remove the character after the current cursor position + removed = RemoveText( 0, + 1, + UPDATE_INPUT_STYLE ); + } if( removed ) {