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-impl.cpp;h=3fe3322af8f2372033c4e87a6a4e78f1ec304d65;hp=12cdae7a39c0097b42cc609d95fd22bdeb4719bc;hb=2daa5af9afa208c6e58b5a69ff304b513777aa63;hpb=3ebd0535e501c221c6cf9019f87890ea6dc35fa2 diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 12cdae7..3fe3322 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -85,7 +85,7 @@ namespace Text EventData::EventData(DecoratorPtr decorator, InputMethodContext& inputMethodContext) : mDecorator(decorator), mInputMethodContext(inputMethodContext), - mPlaceholderFont(NULL), + mPlaceholderFont(nullptr), mPlaceholderTextActive(), mPlaceholderTextInactive(), mPlaceholderTextColor(0.8f, 0.8f, 0.8f, 0.8f), // This color has been published in the Public API (placeholder-properties.h). @@ -797,7 +797,7 @@ bool Controller::Impl::UpdateModel(OperationsMask operationsRequired) startIndex, requestedNumberOfCharacters, bidirectionalInfo, - mModel->mMatchSystemLanguageDirection, + (mModel->mMatchLayoutDirection != DevelText::MatchLayoutDirection::CONTENTS), mLayoutDirection); if(0u != bidirectionalInfo.Count()) @@ -1245,7 +1245,7 @@ CharacterIndex Controller::Impl::GetPrimaryCursorPosition() const return mEventData->mPrimaryCursorPosition; } -bool Controller::Impl::SetPrimaryCursorPosition(CharacterIndex index) +bool Controller::Impl::SetPrimaryCursorPosition(CharacterIndex index, bool focused) { if(nullptr == mEventData) { @@ -1261,10 +1261,14 @@ bool Controller::Impl::SetPrimaryCursorPosition(CharacterIndex index) uint32_t length = static_cast(mModel->mLogicalModel->mText.Count()); mEventData->mPrimaryCursorPosition = std::min(index, length); - ChangeState(EventData::EDITING); - mEventData->mLeftSelectionPosition = mEventData->mRightSelectionPosition = mEventData->mPrimaryCursorPosition; - mEventData->mUpdateCursorPosition = true; - ScrollTextToMatchCursor(); + // If there is no focus, only the value is updated. + if(focused) + { + ChangeState(EventData::EDITING); + mEventData->mLeftSelectionPosition = mEventData->mRightSelectionPosition = mEventData->mPrimaryCursorPosition; + mEventData->mUpdateCursorPosition = true; + ScrollTextToMatchCursor(); + } return true; } @@ -1737,7 +1741,7 @@ void Controller::Impl::GetCursorPosition(CharacterIndex logical, cursorInfo.primaryCursorHeight = cursorInfo.lineHeight; bool isRTL = false; - if(mModel->mMatchSystemLanguageDirection) + if(mModel->mMatchLayoutDirection != DevelText::MatchLayoutDirection::CONTENTS) { isRTL = mLayoutDirection == LayoutDirection::RIGHT_TO_LEFT; } @@ -2106,8 +2110,10 @@ Actor Controller::Impl::CreateBackgroundActor() // Get the background color of the character. // The color index zero is reserved for the default background color (i.e. Color::TRANSPARENT) - const ColorIndex backgroundColorIndex = (nullptr == backgroundColorsBuffer) ? 0u : *(backgroundColorIndicesBuffer + i); - const Vector4& backgroundColor = (0u == backgroundColorIndex) ? defaultBackgroundColor : *(backgroundColorsBuffer + backgroundColorIndex - 1u); + const bool isMarkupBackground = mView.IsMarkupBackgroundColorSet(); + const ColorIndex backgroundColorIndex = isMarkupBackground ? *(backgroundColorIndicesBuffer + i) : 0u; + const bool isDefaultBackgroundColor = (0u == backgroundColorIndex); + const Vector4& backgroundColor = isDefaultBackgroundColor ? defaultBackgroundColor : *(backgroundColorsBuffer + backgroundColorIndex - 1u); mModel->mVisualModel->GetNumberOfLines(i, 1, lineIndex, numberOfLines); Length lineHeight = lineRun[lineIndex].ascender + -(lineRun[lineIndex].descender) + lineRun[lineIndex].lineSpacing;